Default unit type 0
Наследование: IUnitDescriptor
Пример #1
0
 public Type6File(Type6Descriptor desc) : base(desc)
 {
     north = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
     south = new int[] { 24, 25, 26, 27, 28, 29, 30, 31 };
     east  = new int[] { 8, 9, 10, 11, 12, 13, 14, 15 };
     west  = new int[] { 16, 17, 18, 19, 20, 21, 22, 23 };
 }
Пример #2
0
		public Type6File(Type6Descriptor desc):base(desc)
		{
			north = new int[]{0,1,2,3,4,5,6,7};
			south = new int[]{24,25,26,27,28,29,30,31};
			east = new int[]{8,9,10,11,12,13,14,15};
			west = new int[]{16,17,18,19,20,21,22,23};
		}
Пример #3
0
		public UnitInfo(Stream file,VarCollection v):this() 
		{
			StreamReader sr = new StreamReader(file);
			VarCollection vars = new VarCollection(sr,v);
			KeyVal line=vars.ReadLine();

			if(line==null)
				return;

			groundImages = line.Rest;

			while((line=vars.ReadLine())!=null)
			{				
				if(line.Keyword=="unit")
				{
					string name = line.Rest;
					line = vars.ReadLine();

					if(line.Keyword=="type")
					{
						int type = int.Parse(line.Rest);
						switch(type)
						{
							case 0:
								units[name] = new Type0Descriptor(name,sr,vars);
								break;
							case 1: 
								units[name] = new Type1Descriptor(name,sr,vars);
								break;
							case 2:
								units[name] = new Type2Descriptor(name,sr,vars);
								break;
							case 3:
								units[name] = new Type3Descriptor(name,sr,vars);
								break;
							case 4:
								units[name] = new Type4Descriptor(name,sr,vars);
								break;
							case 5:
								units[name] = new Type5Descriptor(name,sr,vars);
								break;
							case 6:
								units[name] = new Type6Descriptor(name,sr,vars);
								break;
							case 7:
								units[name] = new Type7Descriptor(name,sr,vars);
								break;
						}
					}
				}
				else
				{
					xConsole.AddLine("Unknown keyword parsing unit file(1): "+line.Keyword+"->"+line.Rest);
				}
			}
			sr.Close();
		}
Пример #4
0
        public UnitInfo(Stream file, VarCollection v) : this()
        {
            StreamReader  sr   = new StreamReader(file);
            VarCollection vars = new VarCollection(sr, v);
            KeyVal        line = vars.ReadLine();

            if (line == null)
            {
                return;
            }

            groundImages = line.Rest;

            while ((line = vars.ReadLine()) != null)
            {
                if (line.Keyword == "unit")
                {
                    string name = line.Rest;
                    line = vars.ReadLine();

                    if (line.Keyword == "type")
                    {
                        int type = int.Parse(line.Rest);
                        switch (type)
                        {
                        case 0:
                            units[name] = new Type0Descriptor(name, sr, vars);
                            break;

                        case 1:
                            units[name] = new Type1Descriptor(name, sr, vars);
                            break;

                        case 2:
                            units[name] = new Type2Descriptor(name, sr, vars);
                            break;

                        case 3:
                            units[name] = new Type3Descriptor(name, sr, vars);
                            break;

                        case 4:
                            units[name] = new Type4Descriptor(name, sr, vars);
                            break;

                        case 5:
                            units[name] = new Type5Descriptor(name, sr, vars);
                            break;

                        case 6:
                            units[name] = new Type6Descriptor(name, sr, vars);
                            break;

                        case 7:
                            units[name] = new Type7Descriptor(name, sr, vars);
                            break;
                        }
                    }
                }
                else
                {
                    xConsole.AddLine("Unknown keyword parsing unit file(1): " + line.Keyword + "->" + line.Rest);
                }
            }
            sr.Close();
        }