コード例 #1
0
    private IEnumerable <FactionDisplay> CreateFactionsDisplay(UnityObjectManager objectManager, FactionsInteractionManager interactionManager, MapInteraction mapInteraction)
    {
        List <FactionDisplay> ret = new List <FactionDisplay>();

        foreach (FactionInteraction faction in interactionManager.Factions)
        {
            FactionDisplay factionDisplay = new FactionDisplay(faction, objectManager, interactionManager, mapInteraction);
            ret.Add(factionDisplay);
        }
        return(ret);
    }
コード例 #2
0
    public void Initialize()
    {
        ControlledPopulationNodes = new List <GameObject>();
        ControlledMilitary        = new List <SoldierUnit>();
        ControlledSpies           = new List <SpyUnit>();
        FactionRelationShips      = new int[Globals.NumberOfFactions];
        _factionDataDisplay       = new FactionDisplay();

        OnInitializationCollectControlledPopulationNodes();
        OnInitializationCollectControlledUnits();

        Funds = 10000;

        if (Globals.PlayerFaction == FactionId)
        {
            _factionDataDisplay.InitializeTextDisplay();
            _factionDataDisplay.FirstUpdate(FactionId, ControlledPopulationNodes.Count, ControlledSpies.Count, ControlledMilitary.Count, Funds);
        }

        EventManager.StartListening <UnitRecruitmentData>(EventNames.SpyRecruited, OnRecruitSpy);
        EventManager.StartListening <UnitRecruitmentData>(EventNames.MilitaryRecruited, OnRecruitSoldier);
        EventManager.StartListening <SpyOdersData>(EventNames.OrderPropaganda, OnPropagandaOrdered);
    }