コード例 #1
0
 public void Dash(DashCommand dc)
 {
     if (dashDelegate != null)
     {
         dashDelegate();
     }
 }
コード例 #2
0
 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");
     }
 }