Ejemplo n.º 1
0
        protected void SetMask(string path)
        {
            CardMasks mask = new CardMasks();

            string[] lines = System.IO.File.ReadAllLines(path);
            for (int i = 0; i < lines.Length; i++)
            {
                string line = lines[i];
                if (line.Contains("Meadows"))
                {
                    mask.Meadows = GetMaskArray(lines, i + 1);
                    i            = i + 4;
                    continue;
                }
                if (line.Contains("Monastery"))
                {
                    mask.Monastery = GetMaskArray(lines, i + 1);
                    i = i + 4;
                    continue;
                }
                if (line.Contains("Streets"))
                {
                    mask.Streets = GetMaskArray(lines, i + 1);
                    i            = i + 4;
                    continue;
                }
                if (line.Contains("Cities"))
                {
                    mask.Cities = GetMaskArray(lines, i + 1);
                    i           = i + 4;
                    continue;
                }
                if (line.Contains("Grain"))
                {
                    mask.Grain = GetMaskArray(lines, i + 1);
                    i          = i + 4;
                    continue;
                }
                if (line.Contains("Fabric"))
                {
                    mask.Fabric = GetMaskArray(lines, i + 1);
                    i           = i + 4;
                    continue;
                }
                if (line.Contains("Barrel"))
                {
                    mask.Barrel = GetMaskArray(lines, i + 1);
                    i           = i + 4;
                    continue;
                }
                if (line.Contains("Shield"))
                {
                    mask.Shield = GetMaskArray(lines, i + 1);
                    i           = i + 4;
                    continue;
                }
            }
            MyCardMask = mask;
            SetEdges(mask);
        }
Ejemplo n.º 2
0
        private void SetEdges(CardMasks mask)
        {
            if (mask.Meadows[0, 1] != 0)
            {
                EdgeNorth.HasMeadow = true;
            }
            if (mask.Cities[0, 1] != 0)
            {
                EdgeNorth.HasCity = true;
            }
            if (mask.Streets[0, 1] != 0)
            {
                EdgeNorth.HasStreet = true;
            }

            if (mask.Meadows[1, 0] != 0)
            {
                EdgeWest.HasMeadow = true;
            }
            if (mask.Cities[1, 0] != 0)
            {
                EdgeWest.HasCity = true;
            }
            if (mask.Streets[1, 0] != 0)
            {
                EdgeWest.HasStreet = true;
            }

            if (mask.Meadows[1, 2] != 0)
            {
                EdgeEast.HasMeadow = true;
            }
            if (mask.Cities[1, 2] != 0)
            {
                EdgeEast.HasCity = true;
            }
            if (mask.Streets[1, 2] != 0)
            {
                EdgeEast.HasStreet = true;
            }

            if (mask.Meadows[2, 1] != 0)
            {
                EdgeSouth.HasMeadow = true;
            }
            if (mask.Cities[2, 1] != 0)
            {
                EdgeSouth.HasCity = true;
            }
            if (mask.Streets[2, 1] != 0)
            {
                EdgeSouth.HasStreet = true;
            }
        }