public void UsingCommandsShouldDetractOperations() { // Arrange var command = new CommandSlot(new OverloadCommand()); // Act GameViewModel.HandleCommand(command); // Assert Player.Operations.ShouldBeLessThan(Player.MaxOperations); }
public Command GetCommandAtSlot(CommandSlot slot) { foreach (Command command in activeCommands) { if (command.currentSlot == slot) { return(command); } } Debug.Assert(false, "No Command Found at Slot: " + slot.name); return(null); }
protected CommandSlot SetPlayerCommand(GameCommand command) { var playerCommands = GameViewModel.Context.Player.HotbarCommands; playerCommands.Clear(); var slot = new CommandSlot(command); playerCommands.Add(slot); return(slot); }
public void CommandShouldExposeProperties() { // Arrange var command = new OverloadCommand(); var instance = new CommandSlot(command); var gameVM = new GameViewModel(); // Act var vm = new CommandViewModel(instance, gameVM); // Assert vm.Content.ShouldBe(command.ShortName); }
public void MoveTile(CommandSlot from, CommandSlot to){ // Debug.Log("moving tile from slot " + from + " to " + to); CommandTile movingTile = from.tile; from.RemoveTile(); to.SetTile(movingTile); }
public void AddSlot(CommandSlot slot){ slots.Add (slot); }
public void MoveToSlot(CommandSlot slot){ this.transform.position = slot.GetComponent<RectTransform>().position; }
public void SetHome(CommandSlot slot){ home = slot; }
public void Init(CommandSlot slot, Automaton owner) { SetForcingly("slot", slot); SetForcingly("owner", owner); }
public void Deactivate() { currentSlot = null; }
public void Activate(CommandSlot startSlot) { currentSlot = startSlot; currentState = new CommandIdleState(this); currentState.Start(); }
public CommandViewModel([CanBeNull] CommandSlot commandSlot, [NotNull] GameViewModel game) { _game = game ?? throw new ArgumentNullException(nameof(game)); CommandSlot = commandSlot; }
public void AddPlayHeadTarget (CommandSlot slot) { playHead.AddSlot (slot); }