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);
 }
Example #3
0
        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);
        }
Example #5
0
	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);
	}
Example #6
0
	public void AddSlot(CommandSlot slot){
		slots.Add (slot);
	}
Example #7
0
	public void MoveToSlot(CommandSlot slot){
		this.transform.position = slot.GetComponent<RectTransform>().position;
	}
Example #8
0
	public void SetHome(CommandSlot slot){
		home = slot;
	}
Example #9
0
 public void Init(CommandSlot slot, Automaton owner)
 {
     SetForcingly("slot", slot);
     SetForcingly("owner", owner);
 }
Example #10
0
 public void Deactivate()
 {
     currentSlot = null;
 }
Example #11
0
 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;
 }
Example #13
0
	public void AddPlayHeadTarget (CommandSlot slot)
	{
		playHead.AddSlot (slot);
	}