Example #1
0
        private void ConvertToAreaTypes(string[] inString)
        {
            //Name = Name of Area Type , Colour = colour used for map , Value = size used for map
            IAreaType newAreaType;

            locationAreaTypes = new AreaType[inString.Length];
            for (int i = 0; i < inString.Length; i++)
            {
                newAreaType = new AreaType();
                // split sthe string
                string[] parts = inString[i].Split(',');
                for (int j = 0; j < parts.Length; j++)
                {
                    string[] bits = parts[j].Split(':');
                    // add data to new role
                    // = name
                    if (bits[0].ToLower().Equals("name"))
                    {
                        newAreaType.setName(bits[1]);
                    }
                    else if (bits[0].ToLower().Equals("colour"))
                    {
                        newAreaType.setColour(bits[1]);
                    }
                    else if (bits[0].ToLower().Equals("value"))
                    {
                        newAreaType.setValue(bits[1]);
                    }
                    else if (bits[0].ToLower().Equals("desc"))
                    {
                        newAreaType.setDesc(bits[1]);
                    }
                }



                locationAreaTypes[i] = newAreaType;
            }
        }