コード例 #1
0
        public Drone GetDrone(Point startingPosition, CardinalCompassPointEnum direction)
        {
            var controller = new DroneController();
            var drone      = new Drone(startingPosition, direction);

            drone.Controller = controller;
            return(drone);
        }
コード例 #2
0
        public virtual CardinalCompassPointEnum TurnRight(CardinalCompassPointEnum direction)
        {
            switch (direction)
            {
            case CardinalCompassPointEnum.East:
                return(CardinalCompassPointEnum.South);

            case CardinalCompassPointEnum.South:
                return(CardinalCompassPointEnum.West);

            case CardinalCompassPointEnum.West:
                return(CardinalCompassPointEnum.North);

            case CardinalCompassPointEnum.North:
                return(CardinalCompassPointEnum.East);
            }
            return(CardinalCompassPointEnum.East);
        }
コード例 #3
0
ファイル: Drone.cs プロジェクト: stephenjannin/Drones
 public Drone(Point position, CardinalCompassPointEnum direction)
 {
     Direction = direction;
     Position  = position;
 }