예제 #1
0
    public Royalty(KingdomTest kingdom, int age, GENDER gender, int generation)
    {
        this.id         = GetID() + 1;
        this.name       = RandomNameGenerator.GenerateRandomName() + " " + this.id;
        this.age        = age;
        this.gender     = gender;
        this.generation = generation;
        this.kingdom    = kingdom;
        this.trait      = GetTrait();
//		this.trait = new TRAIT[]{TRAIT.VICIOUS, TRAIT.NONE};
        this.loyalLord          = null;
        this.hatedLord          = null;
        this.father             = null;
        this.mother             = null;
        this.spouse             = null;
        this.children           = new List <Royalty> ();
        this.royaltyChances     = new RoyaltyChances();
        this.birthMonth         = (MONTH)PoliticsPrototypeManager.Instance.month;
        this.birthWeek          = PoliticsPrototypeManager.Instance.week;
        this.birthYear          = PoliticsPrototypeManager.Instance.year;
        this.isIndependent      = false;
        this.isMarried          = false;
        this.isDirectDescendant = false;
        this.isDead             = false;
        this.kingdom.royaltyList.allRoyalties.Add(this);
        if (this.kingdom.assignedLord == null)
        {
            this.loyalLord = this;
        }
        else
        {
            this.loyalLord = this.kingdom.assignedLord;
        }

        PoliticsPrototypeManager.Instance.RegisterRoyalty(this);
        SetLastID(this.id);

        RoyaltyEventDelegate.onIncreaseIllnessAndAccidentChance += IncreaseIllnessAndAccidentChance;
        RoyaltyEventDelegate.onChangeIsDirectDescendant         += ChangeIsDirectDescendant;
        RoyaltyEventDelegate.onMassChangeLoyalty    += MassChangeLoyalty;
        PoliticsPrototypeManager.Instance.turnEnded += TurnActions;
    }