Esempio n. 1
0
        public void Parse(string name, out Dictionary<int, MazeData> kvDic)
        {
			LoadFile(name);
			
			kvDic = new Dictionary<int, MazeData>();
			
			while(!EndOfRow)
			{
				int col = 0;
				MazeData data = new MazeData();
				
				data.Kid = ReadInt(col++);
				data.StartCol = ReadInt(col++);
				data.StartRow = ReadInt(col++);
				data.BlockSize = ReadFloat(col++);
				data.Cols = ReadInt(col++);
				data.Rows = ReadInt(col++);
				data.LinkRate = ReadFloat(col++);
				data.PassageRate = ReadFloat(col++);
				data.MonsterMaxCount = ReadInt(col++);
				data.NPCMaxCount = ReadInt(col++);
				data.ExplorationMaxCount = ReadInt(col++);
                data.GlobalExplorationCountDic = ReadDictionary<ExplorationType, int>(col++);
				
				kvDic.Add(data.Kid, data);
				NextLine();
			}
        }
Esempio n. 2
0
		public void Init()
		{
			startTicks = DateTime.Now.Ticks;
			Data = MazeDataManager.Instance.CurrentMazeData;
            if(RandomUtils.Seed == 0)
            {
                RandomUtils.Seed = UnityEngine.Random.Range(0, 20140413);
            }
		}
Esempio n. 3
0
		public void Init()
		{
			mazeData = MazeDataManager.Instance.CurrentMazeData;
			MazeBuilder builder = new MazeBuilder(mazeData);
			mazeTable = builder.Build();
			StartNode = mazeTable.GetNode(mazeData.StartCol, mazeData.StartRow);

            InitGlobalExplorationPositions();
//            TestGlobalExplorationPositions();
		}
Esempio n. 4
0
		public void Dispose()
		{
			blockDic.Clear();
			mockNodeSet.Clear();
            globalExplorationNodeList.Clear();

			ToDeleteNodeList.Clear();
			ToCreateNodeList.Clear();
			prevAroundList.Clear();
			mazeTable = null;
			StartNode = null;
			mazeData = null;
		}
Esempio n. 5
0
	void Awake()
	{
		ConfigManager.Instance.InitAllData();
        Maze.Instance.Init();

        blockProxy = new BlockProxy();
        ApplicationFacade.Instance.RegisterProxy(blockProxy);


        ApplicationFacade.Instance.RegisterMediator(new BlockMediator());

        mazeData = MazeDataManager.Instance.CurrentMazeData;
        PreloadAssets(mazeData.Kid);
    }
Esempio n. 6
0
		public MazeDataConfig ()
		{
			MazeDataDic = new Dictionary<int, MazeData>();
			MazeData data;

			data = new MazeData();
			data.Kid = 1;
			data.Cols = 30;
			data.Rows = 30;
			data.StartCol = 15;
			data.StartRow = 15;
			data.LinkRate = 0.5f;
			data.PassageRate = 0.9f;
			data.BlockSize = 10f;

			data.MonsterMaxCount = 2;
			data.NPCMaxCount = 2;
			data.ExplorationMaxCount = 3;
			MazeDataDic.Add(data.Kid, data);

		}
Esempio n. 7
0
		public MazeBuilder(MazeData data)
        {
			this.mazeData = data;
        }