public void Parse(string name, out Dictionary<int, ExplorationData> kvDic, out Dictionary<ExplorationType, List<ExplorationData>> typeDic)
		{
			LoadFile(name);

			kvDic = new Dictionary<int, ExplorationData>();

			Array values = Enum.GetValues(typeof(ExplorationType));
			typeDic = new Dictionary<ExplorationType, List<ExplorationData>>();
			foreach(var val in values)
			{
				typeDic.Add((ExplorationType)val, new List<ExplorationData>());
			}

			while (!EndOfRow)
			{
				int col = 0;
				ExplorationData data = new ExplorationData();
				data.Kid = ReadInt(col++);
				data.Type = ReadEnum<ExplorationType>(col++);
				data.Res3D = ReadString(col++);
				data.MazeKid = ReadInt(col++);
                data.IsGlobal = ReadBool(col++);
                data.Param1 = ReadString(col++);
                data.Param2 = ReadString(col++);
                data.Param3 = ReadString(col++);
				kvDic.Add(data.Kid, data);
				typeDic[data.Type].Add(data);
				NextLine();
			}
		}
示例#2
0
 private static Exploration DoCreate(ExplorationData data, List<object> paramList)
 {
     Exploration exploration = null;
     switch (data.Type)
     {
         case ExplorationType.Transporter:   
         {
             TransporterExpl expl = new TransporterExpl();
             expl.Data = data;
             TransporterExpl.Init(expl, (TransporterDirectionType)paramList[0]);
             exploration = expl;
             break;
         }
         default:      
         {
             exploration = new Exploration();
             exploration.Data = data;
             Exploration.Init(exploration);
             break;
         }
     }
     return exploration;
 }
        public ExplorationDataConfig()
        {
			IDManager idManager = IDManager.Instance;
			DataDic = new Dictionary<int, ExplorationData>();
			ExplorationData data;

			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 1);
			data.Type = ExplorationType.Chest;
			data.Res3D = "Chest_1";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 2);
			data.Type = ExplorationType.Chest;
			data.Res3D = "Chest_2";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 3);
			data.Type = ExplorationType.Chest;
			data.Res3D = "Chest_3";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 4);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_1";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 5);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_2";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 6);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_3";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 7);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_4";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 8);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_5";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 9);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_6";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 10);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_7";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 11);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_8";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
			data = new ExplorationData();
			data.Kid = idManager.GetID(IDType.Exploration, 12);
			data.Type = ExplorationType.Corpse;
			data.Res3D = "Corpse_9";
			data.MazeKid = idManager.GetID(IDType.Maze, 1);
			DataDic.Add(data.Kid, data);
			
        }