MoodSwingGame.MSMap.MSMap C# (CSharp) Method

MSMap() public method

public MSMap ( String filename ) : System
filename String
return System
        public MSMap(String filename)
            : base(MoodSwing.GetInstance())
        {
            StreamReader sr = new StreamReader(filename);
            string[] line = sr.ReadLine().Split(' ');
            rows = Int32.Parse(line[0]);
            columns = Int32.Parse(line[1]);
            initialVolunteerCenters = 0;
            mapArray = new MS3DTile[rows, columns];
            citizenSources = new List<MSUnchangeableBuilding>();
            for (int j = 0; j < columns; j++)
            {
                line = sr.ReadLine().Split(' ');
                for (int i = 0; i < rows; i++)
                {
                    MS3DTile toAdd = MSTileFactory.CreateMSTile(Int32.Parse(line[i]), new Vector3(j * tileDimension, i * tileDimension, 0), i, j);
                    mapArray[i, j] = toAdd;
                    if (toAdd is MSUnchangeableBuilding)
                        citizenSources.Add(toAdd as MSUnchangeableBuilding);
                    if (toAdd is MSVolunteerCenter)
                        initialVolunteerCenters++;
                }
            }
            LightSource = new Vector3(tileDimension * rows << 1, tileDimension * columns << 1, 10000);
        }