public void Dash(DashCommand dc) { if (dashDelegate != null) { dashDelegate(); } }
public void GetCommand(Command c) { if (c.GetType() == typeof(DashCommand)) { DashCommand dc = (DashCommand)c; Dash(dc); } else if (c.GetType() == typeof(MoveCommand)) { MoveCommand mc = (MoveCommand)c; Move(mc); } else if (c.GetType() == typeof(AttackCommand)) { AttackCommand ac = (AttackCommand)c; Attack(ac); } else { throw new System.Exception("Unknown Command"); } }