示例#1
0
    private void LookTowards(Direction direction)
    {
        if (objectSelector.GetSelectedObject() == null)
        {
            return;
        }

        if (objectSelector.GetSelectedObject().IsType <IMoveable>())
        {
            CommandQueue.Commands command = CommandQueue.Commands.LookDown;
            switch (direction)
            {
            case Direction.N:
                command = CommandQueue.Commands.LookUp;
                break;

            case Direction.S:
                command = CommandQueue.Commands.LookDown;
                break;

            case Direction.E:
                command = CommandQueue.Commands.LookRight;
                break;

            case Direction.W:
                command = CommandQueue.Commands.LookLeft;
                break;
            }
            ((IHasQueue)objectSelector.GetSelectedObject()).AddCommand(command);
        }
    }
示例#2
0
 public bool AddCommand(Commands function)
 {
     return(commandQueue.AddCommand(function));
 }