Пример #1
0
        public void SwitchCheck()
        {
            EventEffect      eventEffect = GameEvent.Instance.eventEffect;
            IEnforcementable enforcementable;

            switchTable.ForEach(table => {
                switch (table.ID)
                {
                case SwitchID.NO1:
                    if (eventEffect.eventTable[(int)EventID.NO7].IsEventOn == true)
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO2:
                    if (eventEffect.eventTable[(int)EventID.NO6].IsEventOn == true)
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO3:
                    if (eventEffect.eventTable[(int)EventID.NO8].IsEventOn == true)
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO4:
                    if (eventEffect.eventTable[(int)EventID.NO17].IsEventOn == true)
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO5:

                    if (PolicyHub.Instance.GetPolicy.TryGetValue(Policy.MissionaryWork, out enforcementable))
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO6:
                    if (PolicyHub.Instance.GetPolicy.TryGetValue(Policy.FoodSaving, out enforcementable))
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO7:
                    if (PolicyHub.Instance.GetPolicy.TryGetValue(Policy.PopulationDownSize, out enforcementable))
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO8:
                    if (PolicyHub.Instance.GetPolicy.TryGetValue(Policy.MedicalIndustry, out enforcementable))
                    {
                        table.IsOn = true;
                    }
                    break;

                case SwitchID.NO9:
                    if (PolicyHub.Instance.GetPolicy.TryGetValue(Policy.ExtraWork, out enforcementable))
                    {
                        table.IsOn = true;
                    }
                    break;

                default:
                    break;
                }
            });
        }
Пример #2
0
 //Constructor
 public EventControl(GameEvent evt, EventEffect evtEffect)
 {
     this.evt       = evt;
     this.evtEffect = evtEffect;
 }