예제 #1
0
        static void TestSimulation(int seed)
        {
            // 던전 테스트--------
            Player[] player = { new Player(), new Player(), new Player(), new Player() };

            PlayerData data = new PlayerData();

            if (TestData.playerList.TryGetValue(102, out data))
            {
                player[0].LoadPlayer(data);
            }

            if (TestData.playerList.TryGetValue(103, out data))
            {
                player[1].LoadPlayer(data);
            }

            if (TestData.playerList.TryGetValue(104, out data))
            {
                player[2].LoadPlayer(data);
            }

            if (TestData.playerList.TryGetValue(101, out data))
            {
                player[3].LoadPlayer(data);
            }

            var start = time.ElapsedMilliseconds;

            Party users = new Party(PartyType.PLAYER, 1);

            foreach (Player p in player)
            {
                users.AddCharacter(p);
            }

            DungeonMaster newMaster = new DungeonMaster();

            newMaster.Init(60, seed, users);

            UpdateResult(newMaster.Start(), time.ElapsedMilliseconds - start);

            // 초기 정보 확인
            // var mapInfo = newMaster.GetMapInfo();
            // var itemList = newMaster.items;
            // var mobList = newMaster.mobs;

            // newMaster.TestPathFinding();
            // Console.ReadLine();
            // Debug.WriteLine( "turn : " + newMaster.Start() );

            // 시뮬레이션 결과 확인
            //             foreach( var each in newMaster.record.pathfinding )
            //             {
            //                 Debug.WriteLine( "x : " + each.x + " / y : " + each.y );
            //             }
            //
            // ------------------
        }
    //OperationBluehole.Content.DungeonMaster dungeonMaster;

    void Awake()
    {
        if (null != instance)
        {
            Debug.LogError(this + " already exist");
            return;
        }

        instance = this;

        // init private variables
        sceneManager  = GameObject.FindGameObjectWithTag("SceneManager");
        dungeonMaster = new OperationBluehole.Content.DungeonMaster();
    }
예제 #3
0
        public Explorer(DungeonMaster master, int size)
        {
            this.dungeonMaster = master;
            map     = new ExploerNode[size, size];
            mapSize = size;

            for (int i = 0; i < size; ++i)
            {
                for (int j = 0; j < size; ++j)
                {
                    map[i, j] = new ExploerNode(dungeonMaster.IsTile(j, i), j, i);
                }
            }
        }