Example #1
0
 public EntityFactory(Func <EntityDefault, Entity> factory, IEntityDefaultReader defaultReader, DefaultPropertyModifierReader defaultPropertyModifierReader, RobotTemplateFactory robotTemplateFactory, ModulePropertyModifiersReader modulePropertyModifiersReader)
 {
     _factory       = factory;
     _defaultReader = defaultReader;
     _defaultPropertyModifierReader = defaultPropertyModifierReader;
     _robotTemplateFactory          = robotTemplateFactory;
     _modulePropertyModifiersReader = modulePropertyModifiersReader;
 }
Example #2
0
 private static Dictionary <MaterialType, MaterialInfo> LoadMaterials(IEntityDefaultReader entityDefaultReader)
 {
     return(Db.Query().CommandText("select * from minerals").Execute().Select(r =>
     {
         var mineral = new MaterialInfo
         {
             Type = r.GetValue <string>("name").ToMaterialType(),
             EntityDefault = entityDefaultReader.Get(r.GetValue <int>("definition")),
             Amount = r.GetValue <int>("amount"),
             EnablerExtensionRequired = r.GetValue <bool>("enablereffectrequired")
         };
         return mineral;
     }).ToDictionary(m => m.Type));
 }
        public LotteryItem(IEntityDefaultReader entityDefaultReader)
        {
            _entityDefaultReader = entityDefaultReader;

            if (_weights == null)
            {
                _weights = Db.Query().CommandText("select * from lotteryitemweights")
                           .Execute()
                           .Select(r =>
                {
                    var lotteryDefinition = r.GetValue <int>("lotterydefinition");
                    var categoryFlags     = r.GetValue <CategoryFlags>("categoryflags");
                    var tierType          = (TierType)r.GetValue <int>("tiertype");
                    var tierLevel         = r.GetValue <int>("tierlevel");
                    var weight            = r.GetValue <double>("weight");
                    var tier = new TierInfo(tierType, tierLevel);

                    return(new WeightInfo(EntityDefault.Get(lotteryDefinition), categoryFlags, tier, weight));
                }).ToLookup(i => i.lotteryItem);
            }
        }
Example #4
0
 public FlockConfigurationBuilder(IEntityDefaultReader entityDefaultReader)
 {
     _entityDefaultReader = entityDefaultReader;
     _configuration       = new FlockConfiguration();
 }
 public RobotTemplateRelations(IRobotTemplateReader robotTemplateReader, IEntityDefaultReader entityDefaultReader)
 {
     _robotTemplateReader = robotTemplateReader;
     _entityDefaultReader = entityDefaultReader;
 }
Example #6
0
 public static EntityDefault GetByName(this IEntityDefaultReader reader, string name)
 {
     return(reader.GetAll().FirstOrDefault(ed => ed.Name == name) ?? EntityDefault.None);
 }
 public ItemDeployerHelper(IEntityDefaultReader entityDefaultReader)
 {
     _entityDefaultReader = entityDefaultReader;
 }
        public GetEntityDefaults(IExtensionReader extensionReader, IEntityDefaultReader entityDefaultReader, IRobotTemplateRelations robotTemplateRelations)
        {
            var cachedEntityDefaultsInfo = entityDefaultReader.GetAll().ToDictionary("d", ed => InfoBuilder.Build(extensionReader, robotTemplateRelations, ed));

            _message = Message.Builder.SetCommand(Commands.GetEntityDefaults).WithData(cachedEntityDefaultsInfo).Build();
        }
 public ModulePropertyModifiersReader(IEntityDefaultReader entityDefaultReader)
 {
     _entityDefaultReader = entityDefaultReader;
 }
 public ZoneDrawBlockingByDefinition(IEntityDefaultReader defaultReader)
 {
     _defaultReader = defaultReader;
 }
Example #11
0
 public MissionDataCache(IExtensionReader extensionReader, IZoneManager zoneManager, IEntityDefaultReader entityDefaultReader)
 {
     _extensionReader     = extensionReader;
     _zoneManager         = zoneManager;
     _entityDefaultReader = entityDefaultReader;
 }
Example #12
0
 public CalibrationProgramCapsule(IEntityDefaultReader entityDefaultReader) : base()
 {
     _entityDefaultReader = entityDefaultReader;
 }
Example #13
0
 public MaterialHelper(IEntityDefaultReader entityDefaultReader)
 {
     _materials = LoadMaterials(entityDefaultReader);
 }
Example #14
0
 public ZoneNpcFlockSet(IEntityDefaultReader defaultReader, IFlockConfigurationRepository repository, FlockConfigurationBuilder.Factory flockConfigurationBuilderFactory)
 {
     _defaultReader = defaultReader;
     _repository    = repository;
     _flockConfigurationBuilderFactory = flockConfigurationBuilderFactory;
 }
 public MarketRobotPriceWriter(IEntityDefaultReader entityDefaultReader, IRobotTemplateRelations robotTemplateRelations)
 {
     _entityDefaultReader    = entityDefaultReader;
     _robotTemplateRelations = robotTemplateRelations;
 }
Example #16
0
 public ProductionDataAccess(IEntityDefaultReader entityDefaultReader)
 {
     _entityDefaultReader = entityDefaultReader;
 }