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);
        }
    }
Exemple #2
0
 public virtual bool TurnTowards(MoveComponent.Direction direction)
 {
     return(moveComponent.TurnTowards(this, direction));
 }