public static ConcreteLayer CaluculateDiff(ConcreteLayer oldLayer, ConcreteLayer newLayer)
        {
            var diff = new ConcreteLayer();

            foreach (var displayvalue in oldLayer)
            {
                var key = displayvalue.Key;
                if (oldLayer[key] != newLayer[key])
                {
                    diff.Add(key, newLayer[key]);
                }
            }

            return(diff);
        }
Beispiel #2
0
        public ConcreteLayer GetGrid()
        {
            var gridstate = new ConcreteLayer();

            for (int i = 0; i <= Sea.GridWidth; i++)
            {
                for (int j = 0; j <= Sea.GridHeight; j++)
                {
                    int value = GetDisplayValue(i, j);
                    var key   = new Tuple <int, int>(i, j);

                    gridstate.Add(key, value);
                }
            }

            return(gridstate);
        }