Пример #1
0
 //MoveCommand MoveA;
 public PlayerInputComponent()
 {
     if (CommandCollection == null || CommandCollection.Commands.Count < 1)
     {
         CommandCollection = new CommandCollection();
         CommandA = new Command("nullCommand");
         CommandB = new Command("nullCommand");
         CommandC = new Command("nullCommand");
         CommandD = new Command("nullCommand");
     }
     else
     {
         for(var i = 0; i < 4; i++)
         {
             switch(i)
             {
                 case 0:
                     CommandA = CommandCollection.Commands[i];
                     break;
                 case 1:
                     CommandB = CommandCollection.Commands[i];
                     break;
                 case 2:
                     CommandC = CommandCollection.Commands[i];
                     break;
                 case 3:
                     CommandD = CommandCollection.Commands[i];
                     break;
                 default:
                     if (CommandA == null) CommandA = new Command("nullCommand");
                     if (CommandB == null) CommandB = new Command("nullCommand");
                     if (CommandC == null) CommandC = new Command("nullCommand");
                     if (CommandD == null) CommandD = new Command("nullCommand");
                     break;
             }
         }
     }
 }
Пример #2
0
 public AIInputComponent()
 {
     CommandCollection = new CommandCollection();
 }