示例#1
0
        public Sector(ISectorMap map,
                      IActorManager actorManager,
                      IStaticObjectManager staticObjectManager,
                      IDropResolver dropResolver,
                      ISchemeService schemeService,
                      IEquipmentDurableService equipmentDurableService)
        {
            ActorManager             = actorManager ?? throw new ArgumentNullException(nameof(actorManager));
            StaticObjectManager      = staticObjectManager ?? throw new ArgumentNullException(nameof(staticObjectManager));
            _dropResolver            = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
            _schemeService           = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
            _equipmentDurableService = equipmentDurableService ??
                                       throw new ArgumentNullException(nameof(equipmentDurableService));

            _diseases = new List <IDisease>();

            ActorManager.Added          += ActorManager_Added;
            ActorManager.Removed        += ActorManager_Remove;
            StaticObjectManager.Added   += StaticObjectManager_Added;
            StaticObjectManager.Removed += StaticObjectManager_Remove;

            Map = map ?? throw new ArgumentException("Не передана карта сектора.", nameof(map));

            PatrolRoutes = new Dictionary <IActor, IPatrolRoute>();
        }
示例#2
0
 public SectorFactory(IDropResolver dropResolver,
                      ISchemeService schemeService,
                      IEquipmentDurableService equipmentDurableService)
 {
     _dropResolver            = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
     _schemeService           = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _equipmentDurableService = equipmentDurableService;
 }
示例#3
0
 public ChestGenerator(ISchemeService schemeService,
                       IDropResolver dropResolver,
                       IChestGeneratorRandomSource chestGeneratorRandomSource)
 {
     _schemeService = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _dropResolver  = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
     _chestGeneratorRandomSource = chestGeneratorRandomSource ?? throw new ArgumentNullException(nameof(chestGeneratorRandomSource));
 }
示例#4
0
 public TemplateBasedPersonFactory(
     ISchemeService schemeService,
     ISurvivalRandomSource survivalRandomSource,
     IPropFactory propFactory,
     IDropResolver dropResolver,
     IPersonPerkInitializator personPerkInitializator,
     IDice dice) : base(schemeService, survivalRandomSource, propFactory, dropResolver, personPerkInitializator,
                        dice)
 {
 }
示例#5
0
 /// <summary>
 /// Конструктор генератора жителей.
 /// </summary>
 /// <param name="schemeService"> Сервис схем. </param>
 /// <param name="dropResolver"> Служба работы с таблицами дропа. Нужна для создания торговцев. </param>
 /// <param name="actorManager"> Менеджер актёров. </param>
 public CitizenGenerator(ISchemeService schemeService,
                         IDropResolver dropResolver,
                         IActorManager actorManager,
                         ICitizenGeneratorRandomSource citizenGeneratorRandomSource)
 {
     _schemeService = schemeService ?? throw new System.ArgumentNullException(nameof(schemeService));
     _dropResolver  = dropResolver ?? throw new System.ArgumentNullException(nameof(dropResolver));
     _actorManager  = actorManager ?? throw new System.ArgumentNullException(nameof(actorManager));
     _citizenGeneratorRandomSource = citizenGeneratorRandomSource ?? throw new System.ArgumentNullException(nameof(citizenGeneratorRandomSource));
 }
示例#6
0
 public ChestGenerator(ISchemeService schemeService,
                       IDropResolver dropResolver,
                       IPropContainerManager propContainerManager,
                       IChestGeneratorRandomSource chestGeneratorRandomSource)
 {
     _schemeService              = schemeService;
     _dropResolver               = dropResolver;
     _propContainerManager       = propContainerManager;
     _chestGeneratorRandomSource = chestGeneratorRandomSource;
 }
示例#7
0
 public TestEmptySectorGenerator(
     IDropResolver dropResolver,
     ISchemeService schemeService,
     IMapFactory mapFactory,
     IEquipmentDurableService equipmentDurableService)
 {
     _dropResolver            = dropResolver ?? throw new System.ArgumentNullException(nameof(dropResolver));
     _schemeService           = schemeService ?? throw new System.ArgumentNullException(nameof(schemeService));
     _mapFactory              = mapFactory ?? throw new System.ArgumentNullException(nameof(mapFactory));
     _equipmentDurableService = equipmentDurableService ?? throw new System.ArgumentNullException(nameof(equipmentDurableService));
 }
示例#8
0
 public RandomHumanPersonFactory(
     ISchemeService schemeService,
     ISurvivalRandomSource survivalRandomSource,
     IPropFactory propFactory,
     IDropResolver dropResolver)
 {
     _schemeService        = schemeService ?? throw new System.ArgumentNullException(nameof(schemeService));
     _survivalRandomSource = survivalRandomSource ?? throw new System.ArgumentNullException(nameof(survivalRandomSource));
     _propFactory          = propFactory ?? throw new System.ArgumentNullException(nameof(propFactory));
     _dropResolver         = dropResolver ?? throw new System.ArgumentNullException(nameof(dropResolver));
 }
示例#9
0
 public SectorFactory(IActorManager actorManager,
                      IPropContainerManager propContainerManager,
                      IDropResolver dropResolver,
                      ISchemeService schemeService,
                      IEquipmentDurableService equipmentDurableService)
 {
     _actorManager            = actorManager ?? throw new ArgumentNullException(nameof(actorManager));
     _propContainerManager    = propContainerManager ?? throw new ArgumentNullException(nameof(propContainerManager));
     _dropResolver            = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
     _schemeService           = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _equipmentDurableService = equipmentDurableService;
 }
示例#10
0
 protected PropDepositFactoryBase(
     string[] toolTags,
     string dropTableSchemeSid,
     PropContainerPurpose propContainerPurpose,
     ISchemeService schemeService,
     IDropResolver dropResolver)
 {
     _toolTags           = toolTags ?? throw new ArgumentNullException(nameof(toolTags));
     _dropTableSchemeSid = dropTableSchemeSid ?? throw new ArgumentNullException(nameof(dropTableSchemeSid));
     _schemeService      = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _dropResolver       = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
     Purpose             = propContainerPurpose;
 }
 public TestEmptySectorGenerator(IActorManager actorManager,
                                 IPropContainerManager propContainerManager,
                                 IDropResolver dropResolver,
                                 ISchemeService schemeService,
                                 IMapFactory mapFactory,
                                 IEquipmentDurableService equipmentDurableService)
 {
     _actorManager            = actorManager;
     _propContainerManager    = propContainerManager;
     _dropResolver            = dropResolver;
     _schemeService           = schemeService;
     _mapFactory              = mapFactory;
     _equipmentDurableService = equipmentDurableService;
 }
示例#12
0
 public RandomHumanPersonFactory(
     ISchemeService schemeService,
     ISurvivalRandomSource survivalRandomSource,
     IPropFactory propFactory,
     IDropResolver dropResolver,
     IPersonPerkInitializator personPerkInitializator,
     IDice dice)
 {
     _schemeService           = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _survivalRandomSource    = survivalRandomSource ?? throw new ArgumentNullException(nameof(survivalRandomSource));
     _propFactory             = propFactory ?? throw new ArgumentNullException(nameof(propFactory));
     _dropResolver            = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
     _personPerkInitializator = personPerkInitializator ?? throw new ArgumentNullException(nameof(personPerkInitializator));
     _dice = dice ?? throw new ArgumentNullException(nameof(dice));
 }
示例#13
0
        public PropDepositModule(IPropContainer propContainer,
                                 IDropTableScheme dropTableScheme,
                                 IDropResolver dropResolver,
                                 string[] toolTags,
                                 int exhaustingValue,
                                 DepositMiningDifficulty depositMiningDifficulty)
        {
            _propContainer   = propContainer ?? throw new ArgumentNullException(nameof(propContainer));
            _dropTableScheme = dropTableScheme ?? throw new ArgumentNullException(nameof(dropTableScheme));
            _dropResolver    = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
            _toolTags        = toolTags ?? throw new ArgumentNullException(nameof(toolTags));

            _exhaustingValue   = exhaustingValue;
            _exhaustingCounter = exhaustingValue;
            Difficulty         = depositMiningDifficulty;
        }
示例#14
0
        public SectorProceduralGenerator(IActorManager actorManager,
                                         IPropContainerManager propContainerManager,
                                         ISectorGeneratorRandomSource randomSource,
                                         IBotPlayer botPlayer,
                                         ISchemeService schemeService,
                                         IDropResolver dropResolver)
        {
            _actorManager         = actorManager;
            _propContainerManager = propContainerManager;
            _randomSource         = randomSource;
            _botPlayer            = botPlayer;
            _schemeService        = schemeService;
            _dropResolver         = dropResolver;

            Log = new StringBuilder();
        }
示例#15
0
文件: Sector.cs 项目: tgspn/Zilon
        public Sector(IMap map,
                      IActorManager actorManager,
                      IPropContainerManager propContainerManager,
                      IDropResolver dropResolver,
                      ISchemeService schemeService)
        {
            _actorManager                  = actorManager;
            _propContainerManager          = propContainerManager;
            _dropResolver                  = dropResolver;
            _schemeService                 = schemeService;
            _actorManager.Added           += ActorManager_Added;
            _propContainerManager.Added   += PropContainerManager_Added;
            _propContainerManager.Removed += PropContainerManager_Remove;

            Map = map ?? throw new ArgumentException("Не передана карта сектора.", nameof(map));

            PatrolRoutes = new Dictionary <IActor, IPatrolRoute>();
        }
 /// <summary>
 /// Создаёт экземпляр <see cref="SectorGenerator"/>.
 /// </summary>
 /// <param name="mapFactory"> Фабрика карты. Сейчас используется <see cref="RoomStyle.RoomMapFactory"/>. </param>
 /// <param name="sectorFactory"> Фабрика сектора. </param>
 /// <param name="monsterGenerator"> Генератор монстров для подземелий. </param>
 /// <param name="chestGenerator"> Генератор сундуков для подземеоий </param>
 /// <param name="monsterPlayer"> Игрок, управляющий монстрами. </param>
 /// <param name="schemeService"> Сервис схем. </param>
 /// <param name="traderManager"> Менеджер торговцев. Нужен для сектора. </param>
 /// <param name="dropResolver"> Служба работы с таблицами дропа. Нужна для создания торговцев. </param>
 public SectorGenerator(
     IMapFactory mapFactory,
     ISectorFactory sectorFactory,
     IMonsterGenerator monsterGenerator,
     IChestGenerator chestGenerator,
     IBotPlayer monsterPlayer,
     ISchemeService schemeService,
     ITraderManager traderManager,//TODO Вынести в отдельный генератор
     IDropResolver dropResolver
     )
 {
     _mapFactory       = mapFactory;
     _sectorFactory    = sectorFactory;
     _monsterGenerator = monsterGenerator;
     _chestGenerator   = chestGenerator;
     _monsterPlayer    = monsterPlayer;
     _schemeService    = schemeService;
     _traderManager    = traderManager;
     _dropResolver     = dropResolver;
 }
示例#17
0
 public StoneDepositFactory(
     ISchemeService schemeService,
     IDropResolver dropResolver) : base(toolTags: new[] { "pick-axe" }, dropTableSchemeSid: "stone-deposit",
                                        PropContainerPurpose.StoneDeposits, schemeService, dropResolver)
 {
 }
示例#18
0
 public DropTableChestStore(IEnumerable <IDropTableScheme> dropTables, IDropResolver dropResolver)
 {
     _dropTables   = dropTables;
     _dropResolver = dropResolver;
 }
示例#19
0
 public DropTableLoot(IDropTableScheme[] dropTables,
                      IDropResolver dropResolver) : base(new DropTableChestStore(dropTables, dropResolver))
 {
     Purpose = PropContainerPurpose.Loot;
 }
示例#20
0
 public DropTablePropChest(IDropTableScheme[] dropTables,
                           IDropResolver dropResolver) : base(new DropTableChestStore(dropTables, dropResolver))
 {
 }
示例#21
0
 public DropTableLoot(IMapNode node,
                      DropTableScheme[] dropTables,
                      IDropResolver dropResolver) : base(node, new DropTableChestStore(dropTables, dropResolver))
 {
 }
示例#22
0
 public PuddleFactory(
     ISchemeService schemeService,
     IDropResolver dropResolver) : base(Array.Empty <string>(), "water-puddle", PropContainerPurpose.Puddle,
                                        schemeService, dropResolver)
 {
 }
示例#23
0
 public CitizenPerson(IDropTableScheme goodsDropTable, IDropResolver dropResolver)
 {
     CitizenType     = CitizenType.Trader;
     _goodsDropTable = goodsDropTable;
     _dropResolver   = dropResolver;
 }
示例#24
0
 public TrashHeapFactory(
     ISchemeService schemeService,
     IDropResolver dropResolver) : base(toolTags: new[] { "shovel" }, dropTableSchemeSid: "trash-heap",
                                        PropContainerPurpose.TrashHeap, schemeService, dropResolver, false)
 {
 }
 public DropTablePropChest(IMapNode node,
                           IDropTableScheme[] dropTables,
                           IDropResolver dropResolver,
                           int id) : base(node, new DropTableChestStore(dropTables, dropResolver), id)
 {
 }
示例#26
0
 public CherryBrushFactory(
     ISchemeService schemeService,
     IDropResolver dropResolver) : base(Array.Empty <string>(), "cherry-brush", PropContainerPurpose.CherryBrush,
                                        schemeService, dropResolver)
 {
 }
示例#27
0
 /// <summary>
 /// Создаёт экземпляр торговца <see cref="Trader"/>.
 /// </summary>
 /// <param name="goodsDropTable"> Таблица дропа, на основе которой будут выдаваться товары.</param>
 /// <param name="node"> Узел карты, в котором стоит торговец. </param>
 /// <param name="dropResolver"> Сервис для работы с таблицами дропа. </param>
 /// <exception cref="ArgumentNullException">
 /// goodsDropTable
 /// or
 /// node
 /// or
 /// dropResolver
 /// </exception>
 public Trader(IDropTableScheme goodsDropTable, IMapNode node, IDropResolver dropResolver)
 {
     _goodsDropTable = goodsDropTable ?? throw new ArgumentNullException(nameof(goodsDropTable));
     Node            = node ?? throw new ArgumentNullException(nameof(node));
     _dropResolver   = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
 }