Example #1
0
        private void BuildNodeDictionary()
        {
            Point worldSize = _environment.WorldSize;

            for (int x = 0; x <= worldSize.X; x++)
            {
                for (int y = 0; y <= worldSize.Y; y++)
                {
                    //bool upLeftBlockOpen = true;
                    //bool upRightBlockOpen = true;
                    //bool bottomLeftBlockOpen = true;
                    //bool bottomRightBlockOpen = true;
                    //if (x == 0)
                    //    upLeftBlockOpen = false;
                    //else if (y == 0)
                    //    upLeftBlockOpen = false;
                    //else
                    //{
                    //    if (!_environment.GameWorld[x-1,y-1].CanAccess)
                    //        upLeftBlockOpen = false;
                    //}
                    //if (x >= worldSize.X)
                    //    upRightBlockOpen = false;
                    //else if (y == 0)
                    //    upRightBlockOpen = false;
                    //else
                    //{
                    //    if (!_environment.GameWorld[x,y-1].CanAccess)
                    //        upRightBlockOpen = false;
                    //}

                    //if (x == 0)
                    //    bottomLeftBlockOpen = false;
                    //else if (y >= worldSize.Y)
                    //    bottomLeftBlockOpen = false;
                    //else
                    //{
                    //    if (!_environment.GameWorld[x - 1, y].CanAccess)
                    //        bottomLeftBlockOpen = false;
                    //}
                    //if (x >= worldSize.X)
                    //    bottomRightBlockOpen = false;
                    //else if (y >= worldSize.Y)
                    //    bottomRightBlockOpen = false;
                    //else
                    //{
                    //    if (!_environment.GameWorld[x, y].CanAccess)
                    //        bottomRightBlockOpen = false;
                    //}
                    NodePoint addNode = new NodePoint(new Point(x, y));
                    _nodeList.Add(new Point(x, y), addNode);
                }
            }
        }
Example #2
0
        public void Reverse()
        {
            NodePoint swapNode = A;

            A = B;
            B = swapNode;
            EnvironmentTile swapTile = LeftTile;

            LeftTile  = RightTile;
            RightTile = swapTile;
        }