コード例 #1
0
ファイル: GameManager.cs プロジェクト: dmaulikr/narivia
        /// <summary>
        /// Starts a new game.
        /// </summary>
        /// <param name="worldId">World identifier.</param>
        /// <param name="factionId">Faction identifier.</param>
        public void NewGame(string worldId, string factionId)
        {
            world = new WorldManager();
            world.LoadWorld(worldId);

            attack = new AttackManager(world);

            InitializeGame(factionId);
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: dmaulikr/narivia
        /// <summary>
        /// Starts a new game as a random faction.
        /// </summary>
        /// <param name="worldId">World identifier.</param>
        public void NewGame(string worldId)
        {
            world = new WorldManager();
            world.LoadWorld(worldId);

            attack = new AttackManager(world);

            Faction faction = GetFactions().Where(f => f.Id != GameDefines.GAIA_FACTION).GetRandomElement();

            InitializeGame(faction.Id);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameManager"/> class.
        /// </summary>
        public GameManager()
        {
            entityManager = new EntityManager();
            entityManager.LoadContent();

            currentPlayer = entityManager.GetPlayer();

            inventoryManager = new InventoryManager(currentPlayer, entityManager);
            combatManager    = new CombatManager(inventoryManager);
            questManager     = new QuestManager();
            worldManager     = new WorldManager();

            questManager.LoadContent();

            worldManager.LoadContent();
            worldManager.LoadWorld(currentPlayer.World);
        }