Exemplo n.º 1
0
        private static void turnRight(RotationKeys rotationKey)
        {
            RobotEntity robotEntity = RobotEntity.getInstance();

            switch (robotEntity.Direction)
            {
            case Directions.E:
                robotEntity.Direction = Directions.S;
                break;

            case Directions.N:
                robotEntity.Direction = Directions.E;
                break;

            case Directions.S:
                robotEntity.Direction = Directions.W;
                break;

            case Directions.W:
                robotEntity.Direction = Directions.N;
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private static void turnRight(RotationKeys rotationKey)
        {
            RobotEntity robotEntity = RobotEntity.getInstance();

            switch (robotEntity.Direction)
            {
            case Directions.EAST:
                robotEntity.Direction = Directions.SOUTH;
                break;

            case Directions.NORTH:
                robotEntity.Direction = Directions.EAST;
                break;

            case Directions.SOUTH:
                robotEntity.Direction = Directions.WEST;
                break;

            case Directions.WEST:
                robotEntity.Direction = Directions.NORTH;
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        public void AddRotationValue(string id, float time, double value)
        {
            if (RotationKeys == null)
            {
                RotationKeys = new Dictionary <float, float3>();
            }

            float3 tmp = new float3();

            if (RotationKeys.TryGetValue(time, out tmp))
            {
                if (id == "x")
                {
                    tmp.y = -(float)value;
                }
                if (id == "y")
                {
                    tmp.x = -(float)value;
                }
                if (id == "z")
                {
                    tmp.z = -(float)value;
                }

                RotationKeys[time] = tmp;
            }

            else
            {
                if (id == "x")
                {
                    tmp = new float3(0, -(float)value, 0);
                }
                if (id == "y")
                {
                    tmp = new float3(-(float)value, 0, 0);
                }
                if (id == "z")
                {
                    tmp = new float3(0, 0, -(float)value);
                }

                RotationKeys.Add(time, tmp);
            }
        }