initial project
This commit is contained in:
29
core/src/com/darkrp2d/input/CommandStream.java
Normal file
29
core/src/com/darkrp2d/input/CommandStream.java
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.darkrp2d.input;
|
||||
|
||||
import com.darkrp2d.input.commands.Command;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author gulum
|
||||
*/
|
||||
public class CommandStream {
|
||||
|
||||
private static Queue<Command> commandStream = new LinkedList<Command>();
|
||||
|
||||
|
||||
public static boolean registerCommand(Command com) {
|
||||
return commandStream.offer(com);
|
||||
}
|
||||
|
||||
public static Command pollCommand() {
|
||||
return commandStream.poll();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user