Britbot
Britbot.HeadingVector.HeadingVector ( Direction  d = Direction.NOTHING) [inline]

Conversion constructor: takes a direction of the game and turns it into a vector.

Parameters:
dThe game direction class(namely south,east,west...)

Definition at line 37 of file HeadingVector.cs.

        {
            switch (d)
            {
                case Direction.NORTH:
                    X = 0;
                    Y = -1;
                    break;
                case Direction.EAST:
                    X = 1;
                    Y = 0;
                    break;
                case Direction.SOUTH:
                    X = 0;
                    Y = 1;
                    break;
                case Direction.WEST:
                    X = -1;
                    Y = 0;
                    break;
                default:
                    X = 0;
                    Y = 0;
                    break;
            }
        }