Ejemplo n.º 1
0
        public void createLightWall()
        {
            string result = Jogo.ConsultarParede();



            if (result != String.Empty && !result.StartsWith("ERRO"))
            {
                result = result.Trim().Replace("\n", String.Empty);
                String[] infos = result.Split('\r');
                foreach (String info in infos)
                {
                    String[] tileInfo = info.Split(',');

                    int lineId = Convert.ToInt32(tileInfo[0]);
                    int tileId = Convert.ToInt32(tileInfo[2]);
                    if (lineId > wall.Count)
                    {
                        wall.Add(new Line(lineId));
                    }

                    Line line = this.wall.SingleOrDefault(item => item.id == lineId);
                    Tile tile = new Tile(tileId);
                    tile.color = lightColors[tile.id];
                    line.tiles.Add(tile);
                }
            }
        }