예제 #1
0
 public void Destory()
 {
     this.m_BuilderModule             = null;
     this.m_BuildingModule            = null;
     this.m_PlayerModule              = null;
     this.m_ArmyModule                = null;
     this.m_ItemModule                = null;
     this.m_ShopModule                = null;
     this.m_RemovableModule           = null;
     this.m_TaskModule                = null;
     this.m_PropsModule               = null;
     this.m_DefenseModule             = null;
     this.m_AchievementBuildingModule = null;
     this.m_CurrentFriend             = null;
 }
예제 #2
0
    public void Initialize(UserData userData, List <BuildingData> buildingData, List <ArmyData> armyData, List <ItemData> itemData,
                           List <ObjectUpgrade <ArmyType> > armyUpgrade, List <ObjectUpgrade <ItemType> > itemUpgrade, List <RemovableObjectData> removableObjects,
                           List <TaskInformation> tasks, Dictionary <MercenaryIdentity, MercenaryData> mercenaries, Dictionary <int, PropsData> props, List <DefenseObjectData> defenseObjects,
                           int removableObjectStartNo, int propsStartNo, List <AchievementBuildingData> achievementBuildings, int achievementBuildingStartNo)
    {
        this.m_BuilderModule = new BuilderManager();

        this.m_PlayerModule    = new PlayerLogicObject();
        this.m_BuildingModule  = new BuildingModule(this.m_BuilderModule);
        this.m_ArmyModule      = new ArmyModule();
        this.m_ItemModule      = new ItemModule();
        this.m_MercenaryModule = new MercenaryModule();
        this.m_ShopModule      = new ShopModule();
        this.m_RemovableModule = new RemovableObjectModule(this.m_BuilderModule);

        this.m_MercenaryModule.InitializeMercenaries(mercenaries);
        this.m_ItemModule.InitializeItem(itemData, itemUpgrade);
        this.m_ArmyModule.InitializeArmy(armyData, armyUpgrade);
        this.m_PlayerModule.IntializePlayer(userData);
        this.m_BuildingModule.IntializeBuilding(buildingData);
        this.m_RemovableModule.InitialWithData(removableObjects, removableObjectStartNo);

        this.m_BuildingModule.ItemUpgradeFinished += ItemUpgradeFinished;
        this.m_BuildingModule.ArmyUpgradeFinished += ArmyUpgradeFinished;

        this.m_IsNewPlayer = (removableObjects.Count == ClientSystemConstants.INITIAL_REMOVABLE_OBJECT_NUMBER) &&
                             (removableObjects[0].Position == null);


        this.m_TaskModule = new TaskManager();
        foreach (TaskInformation info in tasks)
        {
            TaskProgressFactory.PopulateTaskInformation(info);
        }
        this.m_TaskModule.InitialTask(tasks);

        this.m_PropsModule = new PropsModule();
        this.m_PropsModule.InitializeProps(props, propsStartNo);
        this.m_DefenseModule = new DefenseObjectModule();
        this.m_DefenseModule.InitialDefenseObject(defenseObjects);
        this.m_AchievementBuildingModule = new AchievementBuildingModule();
        this.m_AchievementBuildingModule.InitialAchievementBuilding(achievementBuildings, achievementBuildingStartNo);
    }