protected TableManagerHost(BridgeEventBus bus, string name) : base(bus, name) { this.clients = new SeatCollection <ClientData>(); this.moreBoards = true; this.lagTimer = new System.Diagnostics.Stopwatch(); this.ThinkTime = new DirectionDictionary <System.Diagnostics.Stopwatch>(new System.Diagnostics.Stopwatch(), new System.Diagnostics.Stopwatch()); this.boardTime = new DirectionDictionary <TimeSpan>(new TimeSpan(), new TimeSpan()); this.waiter = new SemaphoreSlim(initialCount: 0); Task.Run(async() => { await this.ProcessMessages(); }); }
public void Move(InputAction.CallbackContext context) { if (activeObject != null) { Vector2Int possibleMove = Vector2Int.RoundToInt(context.ReadValue <Vector2>()); //If the possible move is a free direction for the block, move that way if (DirectionDictionary.HasKey(possibleMove)) { //Disgusting but takes Vector3 -> String direction -> integer index if (activeObject.GetComponent <Block>().GetFreeDirections()[DirectionDictionary.GetIndex(DirectionDictionary.GetDirection(possibleMove))]) { GameCommand command = new MoveCommand(activeObject.GetComponent <Rigidbody2D>(), possibleMove); oldCommands.Add(command); command.Execute(); } } } }