public void ControlInUse()
 {
     if (m_myAxis != null)
     {
         float axis = getValue();
         if (axis != 0)
         {
             m_myAxis.Execute(axis);
         }
         else
         {
             m_myAxis.Execute(0);
         }
     }
     else
     {
         if (getValue() > 0)
         {
             m_myCommandA.Execute();
         }
         else
         {
             m_myCommandA.ExecuteOnUp();
         }
     }
 }
Exemple #2
0
    public static void Main(string[] args)
    {
        IReceiver receiver = new Receiver();

        ICommand commandA = new CommandA(receiver);
        ICommand commandB = new CommandB(receiver);

        commandA.Execute();
        commandB.Execute();
    }