Exemplo n.º 1
0
        public static List <GridRelativeState <T> > AsGridRelativeStateList <T>(IStateGrid <T> stateGrid, int xOffset, int yOffset)
        {
            List <GridRelativeState <T> > toReturn = new List <GridRelativeState <T> >();

            for (int x = 0; x < stateGrid.Width; x++)
            {
                for (int y = 0; y < stateGrid.Height; y++)
                {
                    GridRelativeState <T> state = new GridRelativeState <T>(
                        x + xOffset,
                        y + yOffset,
                        stateGrid.GetStateAtPosition(x, y));

                    toReturn.Add(state);
                }
            }

            return(toReturn);
        }
Exemplo n.º 2
0
        public GridRelativeState <T> Clone()
        {
            GridRelativeState <T> toReturn = new GridRelativeState <T>(X, Y, State);

            return(toReturn);
        }