public IPerson Create(IMonsterScheme monsterScheme) { var monsterPerson = new MonsterPerson(monsterScheme); var Acts = new ITacticalAct[] { new MonsterTacticalAct(monsterScheme.PrimaryAct) }; var combaActModule = new MonsterCombatActModule(Acts); monsterPerson.AddModule(combaActModule); var defenses = monsterScheme.Defense?.Defenses? .Select(x => new PersonDefenceItem(x.Type, x.Level)) .ToArray(); var defenceStats = new PersonDefenceStats( defenses ?? Array.Empty <PersonDefenceItem>(), Array.Empty <PersonArmorItem>()); var combatStatsModule = new MonsterCombatStatsModule(defenceStats); monsterPerson.AddModule(combatStatsModule); var survivalModule = new MonsterSurvivalModule(monsterScheme); monsterPerson.AddModule(survivalModule); var diseaseModule = new MonsterDiseaseModule(); monsterPerson.AddModule(diseaseModule); return(monsterPerson); }
public CombatStatsModule(IEvolutionModule evolutionModule, IEquipmentModule equipmentModule) { DefenceStats = new PersonDefenceStats(Array.Empty <PersonDefenceItem>(), Array.Empty <PersonArmorItem>()); IsActive = true; _evolutionModule = evolutionModule ?? throw new ArgumentNullException(nameof(evolutionModule)); _equipmentModule = equipmentModule ?? throw new ArgumentNullException(nameof(equipmentModule)); _equipmentModule.EquipmentChanged += EquipmentModule_EquipmentChanged; }
public IPerson Create(IMonsterScheme monsterScheme) { var monsterPerson = new MonsterPerson(monsterScheme); if (MonsterIdentifierGenerator != null) { monsterPerson.Id = MonsterIdentifierGenerator.GetNewId(); } var movingModule = new MonsterMovingModule(monsterScheme); monsterPerson.AddModule(movingModule); if (monsterScheme?.PrimaryAct is null) { throw new InvalidOperationException(); } var Acts = new ITacticalAct[] { new MonsterTacticalAct(monsterScheme.PrimaryAct) }; var combaActModule = new MonsterCombatActModule(Acts); monsterPerson.AddModule(combaActModule); var defenses = monsterScheme.Defense?.Defenses? .Where(x => x != null) .Select(x => x !) .Select(x => new PersonDefenceItem(x.Type, x.Level)) .ToArray(); var defenceStats = new PersonDefenceStats( defenses ?? Array.Empty <PersonDefenceItem>(), Array.Empty <PersonArmorItem>()); var combatStatsModule = new MonsterCombatStatsModule(defenceStats); monsterPerson.AddModule(combatStatsModule); var survivalModule = new MonsterSurvivalModule(monsterScheme); monsterPerson.AddModule(survivalModule); var diseaseModule = new MonsterDiseaseModule(); monsterPerson.AddModule(diseaseModule); return(monsterPerson); }
public CombatStats() { DefenceStats = new PersonDefenceStats(new PersonDefenceItem[0], new PersonArmorItem[0]); }