//---------------------------------------------------------------- public GameServer() { this.operationLock = new object(); this.loopEvent = new AutoResetEvent(false); this.userOperations = new Queue <Packet>(); // Game Logic 관련 this.roomManager = new GameRoomManager(); this.matchingUserLst = new List <GameUser>(); this.logicThread = new Thread(GameLoop); this.logicThread.Start(); }
public GameRoom(GameRoomManager manager) { this.players = new Player[2]; this.playerState = new Dictionary <byte, PlayerState>(); this.currentPlayer = 0; movingLst = new List <KeyValuePair <Vector2, Vector2> > [2]; movingLst[0] = new List <KeyValuePair <Vector2, Vector2> >(); movingLst[1] = new List <KeyValuePair <Vector2, Vector2> >(); this.EMPTY = new KeyValuePair <byte, Unit>(255, null); this.manager = manager; // 7 * 7(총 49칸)모양의 Board을 구성 // 초기에는 모두 빈 공간이므로 EMPTY_SLOT으로 채움 this.gameBoard = new KeyValuePair <byte, Unit> [COLUMN, ROW]; ResetBoard(); }