示例#1
0
 public RulerTerm(Imperator.Countries.RulerTerm imperatorRulerTerm, GovernmentMapper governmentMapper)
 {
     if (imperatorRulerTerm.CharacterId is not null)
     {
         CharacterId = "imperator" + imperatorRulerTerm.CharacterId.ToString();
     }
     StartDate = imperatorRulerTerm.StartDate;
     if (imperatorRulerTerm.Government is not null)
     {
         Government = governmentMapper.GetCK3GovernmentForImperatorGovernment(imperatorRulerTerm.Government);
     }
 }
示例#2
0
    public RulerTerm(
        Imperator.Countries.RulerTerm imperatorRulerTerm,
        Characters.CharacterCollection characters,
        GovernmentMapper governmentMapper,
        LocDB locDB,
        ReligionMapper religionMapper,
        CultureMapper cultureMapper,
        NicknameMapper nicknameMapper,
        ProvinceMapper provinceMapper
        )
    {
        if (imperatorRulerTerm.CharacterId is not null)
        {
            CharacterId = $"imperator{imperatorRulerTerm.CharacterId}";
        }
        StartDate = imperatorRulerTerm.StartDate;
        if (imperatorRulerTerm.Government is not null)
        {
            Government = governmentMapper.GetCK3GovernmentForImperatorGovernment(imperatorRulerTerm.Government);
        }

        PreImperatorRuler = imperatorRulerTerm.PreImperatorRuler;
        if (PreImperatorRuler?.Country is not null)
        {
            // create a new ruler character
            var character = new Character(
                PreImperatorRuler,
                StartDate,
                PreImperatorRuler.Country,
                locDB,
                religionMapper,
                cultureMapper,
                nicknameMapper,
                provinceMapper
                );
            characters.Add(character);
            CharacterId = character.Id;
        }
    }