public void ClickEnd() { IWorldCommand cmd = currentMode.ClickEnd(Input.mousePosition); IWorldCommand invCmd = cmd.Excecute(); inverseCommands.Push(invCmd); }
public IWorldCommand ClickEnd(Vector2 mousePosition) { if (!validClickStart) { return(NullCommand.instance); } IWorldCommand action = GetActionCommand(mousePosition); validClickStart = false; return(action); }
public override IWorldCommand Excecute() { List <IWorldCommand> inverseCommands = new List <IWorldCommand> (); foreach (IWorldCommand cmd in commands) { IWorldCommand inverseCmd = cmd.Excecute(); if (inverseCmd != NullCommand.instance) { inverseCommands.Add(inverseCmd); } } if (inverseCommands.Count == 0) { return(NullCommand.instance); } return(new CompositeCommand(level, inverseCommands)); }