Example #1
0
        public FullSqlQuery(DbManager dbManager, bool ignoreLazyLoad = false, FactoryType factoryType = FactoryType.LazyLoading)
            : base(dbManager)
        {
            dbManager.MappingSchema = new FullMappingSchema(dbManager, ignoreLazyLoad, dbManager.MappingSchema, factoryType);

            _ignoreLazyLoad = ignoreLazyLoad;
        }
 public FullMappingSchema(DbManager db, bool ignoreLazyLoad = false, MappingSchema parentMappingSchema = null, 
     FactoryType factoryType = FactoryType.LazyLoading)
 {
     _db = db;
     _parentMappingSchema = parentMappingSchema;
     _factoryType = factoryType;
     _ignoreLazyLoad = ignoreLazyLoad;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PlatformJavaObjectFactoryProxy" /> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="factoryClassName">Name of the factory class.</param>
 /// <param name="payload">The payload.</param>
 /// <param name="properties">The properties.</param>
 protected PlatformJavaObjectFactoryProxy(FactoryType type, string factoryClassName, object payload, 
     IDictionary<string, object> properties)
 {
     _factoryType = type;
     _factoryClassName = factoryClassName;
     _payload = payload;
     _properties = properties;
 }
        public CollectionFullObjectMapper(DbManager db, FactoryType factoryType)
        {
            _db = db;
            _factoryType = factoryType;

            PropertiesMapping = new List<IMapper>();
            PrimaryKeyValueGetters = new List<GetHandler>();
            PrimaryKeyNames = new List<string>();
        }
        public FullObjectMapper(DbManager db, bool ignoreLazyLoading, FactoryType factoryType)
        {
            _db = db;
            _ignoreLazyLoad = ignoreLazyLoading;
            _factoryType = factoryType;

            PropertiesMapping = new List<IMapper>();
            PrimaryKeyValueGetters = new List<GetHandler>();
            PrimaryKeyNames = new List<string>();
        }
Example #6
0
 public static DAOFactory GetDAOFactory(FactoryType factoryType)
 {
     switch (factoryType)
     {
         case FactoryType.MySQL:
             return new MySQLDAOFactory();
         default:
             return null;
     }
 }
Example #7
0
 private AbstractPartFactory GetFactory(FactoryType type)
 {
     if(type == FactoryType.Car )
     {
         return new CarPartsFactory();
     }
     else
     {
         return new VanPartsFactory();
     }
 }
Example #8
0
        /// <summary>
        /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory" />.
        /// </summary>
        public Factory(FactoryType factoryType, DebugLevel debugLevel)
            : base(IntPtr.Zero)
        {
            FactoryOptions? options = null;

            if (debugLevel != DebugLevel.None)
                options = new FactoryOptions() { DebugLevel = debugLevel };

            IntPtr temp;
            D2D1.CreateFactory(factoryType, Utilities.GetGuidFromType(GetType()), options, out temp);
            FromTemp(temp);
        }
 public Unit(String _Classname, String _Image, String _Name, UnitType _Type, int _Price, int _BuildTime, int _Upgradelevel, FactoryType _Factory, String _Script, Side _Side)
 {
     Classname = _Classname;
     Image = _Image;
     Name = _Name;
     Type = _Type;
     Price = _Price;
     BuildTime = _BuildTime;
     UpgradeLevel = _Upgradelevel;
     Factory = _Factory;
     Script = _Script;
     Side = _Side;
 }
Example #10
0
        public IItemFactory GetFactory(FactoryType factoryType)
        {
            switch (factoryType)
            {
                case FactoryType.Hat:
                    return new HatFactory();
                case FactoryType.Chest:
                    return new ChestFactory();
                case FactoryType.Weapon:
                    return new WeaponFactory();
            }

            throw new ArgumentOutOfRangeException("factoryType");
        }
Example #11
0
        public void Run(FactoryType type)
        {
            AbstractPartFactory factory = GetFactory(type);

            IBody body = factory.CreateBody();
            IChassis chassis = factory.CreateChassis();
            IGlassware glass = factory.CreateGlassware();

            Console.WriteLine("-----------------------------");
            Console.WriteLine("body parts created: " + body.BodyParts);
            Console.WriteLine("chassis parts created: " + chassis.ChassisParts);
            Console.WriteLine("glassware parts created: " + glass.GlasswareParts);
            Console.WriteLine("-----------------------------");
        }
Example #12
0
        public Factory(FactoryType factorytype, ParticleManagement particleManager, GraphicsDevice graphicsDevice)
            : base()
        {
            this.factoryType = factorytype;
            this.graphicsDevice = graphicsDevice;
            numTrashWaiting = 0;
            listTimeTrashProcessing = new List<double>();
            random = new Random();
            partId = -1; // Logic to Draw animated sprites depends on positive partID
            cycleTime = TimeSpan.FromMilliseconds(500.0);
            lastCycledTime = TimeSpan.Zero;
            currentTextureIndex = 0;
            currentFogColor = Vector3.One;

            // building construction state management
            underConstruction = true;
            constructionIndex = 0;
            lastConstructionSwitchTime = TimeSpan.Zero;
            constructionSwitchSpan = TimeSpan.FromSeconds(3);
            this.particleManager = particleManager;
            //buildingSoundInstance = PoseidonGame.audio.buildingSound.CreateInstance();

            //for animating trash processing
            switch (factoryType)
            {
                // These part id's were found out by experimentation. If we happen to change the model in future,
                // I'll need to find these part ids again. So, I have made them configurable from GameConstant
                case FactoryType.biodegradable:
                    partId = GameConstants.biofactoryPartId;
                    break;
                case FactoryType.radioactive:
                    partId = GameConstants.nuclearfactoryPartId;
                    break;
                case FactoryType.plastic:
                    partId = GameConstants.plasticfactoryPartId;
                    break;
            }
        }
 public FactoryMethodAttribute(FactoryType registerAs)
 {
     RegisterAs = registerAs;
 }
 public FactoryMethodAttribute(FactoryType registerAs, InstanceMode instanceMode)
 {
     RegisterAs   = registerAs;
     InstanceMode = instanceMode;
 }
Example #15
0
 /// <summary>
 /// Creates a new instance of the <see cref="Factory2"/> class with the specified <see cref="FactoryType"/>.
 /// </summary>
 /// <param name="factoryType">The factory threading type.</param>
 public Factory2(FactoryType factoryType)
     : base(factoryType)
 {
 }
Example #16
0
 public GameObject GetGameOjectResource(FactoryType factoryType, string resourcePath)
 {
     return(factoryManager.factoryDict[factoryType].GetItem(resourcePath));
 }
Example #17
0
 /// <summary>
 /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory1" />.
 /// </summary>
 public Factory1(FactoryType factoryType)
     : this(factoryType, DebugLevel.None)
 {
 }
Example #18
0
 public GameObject GetGameObjectResource(FactoryType factoryType, string resourcePath)
 {
     return(mGameManager.GetGameObjectResource(factoryType, resourcePath));
 }
Example #19
0
 /// <summary>Creates info by supplying all the properties and chaining it with current (parent) info.</summary>
 public Request Push(
     Type serviceType, Type requiredServiceType, object serviceKey, string metadataKey, object metadata, IfUnresolved ifUnresolved,
     int factoryID, FactoryType factoryType, Type implementationType, int reuseLifespan) =>
 new Request(serviceType, requiredServiceType, serviceKey, metadataKey, metadata, ifUnresolved,
             factoryID, factoryType, implementationType, reuseLifespan, this);
Example #20
0
 public static extern HResult DWriteCreateFactory(
     FactoryType factoryType,
     in Guid riid,
Example #21
0
 public void Print(FactoryType type)
 {
     _factory.Produce(type);
 }
Example #22
0
 public Factory(FactoryType type)
 {
     this.Name = name[(int)type];
 }
Example #23
0
 public FactoryBuilding(int x, int y, string faction) : base(x, y, 100, faction, '~')
 {
     type            = (FactoryType)GameEngine.random.Next(0, 2);
     productionSpeed = GameEngine.random.Next(3, 7);
 }
Example #24
0
 internal static DWRITE_FACTORY_TYPE Convert(FactoryType factoryType)
 {
 }
Example #25
0
 // 将游戏物体放回对象池的方法
 public void PushItem(FactoryType factoryType, string itemName, GameObject item)
 {
     mGameManager.PushItem(factoryType, itemName, item);
 }
Example #26
0
    /// <summary>
    /// Builds the factory.
    /// </summary>
    /// <returns>创建成功返回true,否则返回false</returns>
    /// <param name="buildType">Build type.</param>
    public bool BuildFactory(FactoryType buildType)
    {
        switch (buildType)
        {
        case FactoryType.FeedMill:
            //TODO Instantiate<Factory> Prefab
            Debug.Log("生成一个饲料厂");
            if (DBHandler.Instance.Coins < BuildingConfig.Instance.Container.factoryList["FeedMill"].Cost)
            {
                return(false);
            }
            FeedMill feedMillPrefab = Resources.Load <FeedMill>("");
            FeedMill feedMill       = Instantiate(feedMillPrefab);
            feedMill.Id = factoryDictionary.Count + 1;
            factoryDictionary.Add(factoryDictionary.Count + 1, feedMill);
            break;

        case FactoryType.MilkPlant:
            //TODO Instantiate<House> Prefab
            Debug.Log("生成一个乳品厂");
            if (DBHandler.Instance.Coins < BuildingConfig.Instance.Container.factoryList["MilkPlant"].Cost)
            {
                return(false);
            }
            MilkPlant milkPlantPrefab = Resources.Load <MilkPlant>("");
            MilkPlant milkPlant       = Instantiate(milkPlantPrefab);
            milkPlant.Id = factoryDictionary.Count + 1;
            factoryDictionary.Add(factoryDictionary.Count + 1, milkPlant);
            break;

        case FactoryType.SugarHouse:
            //TODO Instantiate<Store> Prefab
            Debug.Log("生成一个制糖厂");
            if (DBHandler.Instance.Coins < BuildingConfig.Instance.Container.factoryList["SugarHouse"].Cost)
            {
                return(false);
            }
            SugarHouse SugarHousePrefab = Resources.Load <SugarHouse>("");
            SugarHouse sugarHouse       = Instantiate(SugarHousePrefab);
            sugarHouse.Id = factoryDictionary.Count + 1;
            factoryDictionary.Add(factoryDictionary.Count + 1, sugarHouse);
            break;

        //case FactoryType.TextileMill:
        //    //TODO Instantiate<Store> Prefab
        //    Debug.Log("生成一个纺织厂");
        //    break;
        //case FactoryType.SnackFactory:
        //    //TODO Instantiate<Store> Prefab
        //    Debug.Log("生成一个零食厂");
        //    break;
        //case FactoryType.Deli:
        //    //TODO Instantiate<Store> Prefab
        //    Debug.Log("生成一个烘焙坊");
        //    break;
        //case FactoryType.Tailor:
        ////TODO Instantiate<Store> Prefab
        //Debug.Log("生成一个裁缝店");
        //break;
        default:
            return(false);
        }
        return(true);
    }
Example #27
0
        public bool checkPattern(Packet.DataType type, string text)
        {
            IfType x = FactoryType.CreateType(type);

            return(x.checkStringPattern(text));
        }
Example #28
0
 public void PushGameObjectToFactory(FactoryType factoryType, string resourcePath, GameObject itemGo)
 {
     mGameManager.PushGameObjectToFactory(factoryType, resourcePath, itemGo);
 }
Example #29
0
        public bool checkMinMax(Packet.DataType type, string input, string min, string max)
        {
            IfType x = FactoryType.CreateType(type);

            return(x.checkMinMax(input, min, max));
        }
Example #30
0
 /// <summary>
 /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory" />.
 /// </summary>
 public Factory(FactoryType factoryType)
     : base(IntPtr.Zero)
 {
     DWrite.CreateFactory(factoryType, Utilities.GetGuidFromType(typeof(Factory)), this);
 }
Example #31
0
 public Factory[] GetRegisteredFactories(Type serviceType, object serviceKey, FactoryType factoryType)
 {
     throw new NotImplementedException();
 }
Example #32
0
 //Boss
 public GameObject GetGameObjectResourceInstan(FactoryType factoryType, string resourcePath, Transform trans)
 {
     return factoryManager.factoryDict[factoryType].GetItemInstan(resourcePath, trans);
 }
Example #33
0
 //放回游戏物体 对象池
 public void PushGameObjectToFactory(FactoryType type, string itemName, GameObject item)
 {
     factoryManager.factoryDict[type].PushItem(itemName, item);
 }
Example #34
0
 public void PushGameObjectToFactory(FactoryType factoryType, string resourcePath, GameObject itemGo)
 {
     factoryManager.factoryDict[factoryType].PushItem(resourcePath, itemGo);
 }
 public FactoryMethodAttribute(FactoryType registerAs)
 {
     RegisterAs = registerAs;
 }
Example #36
0
 /// <summary>
 /// Creates a new instance of the <see cref="Factory2"/> class with the specified <see cref="FactoryType"/> and <see cref="DebugLevel"/>.
 /// </summary>
 /// <param name="factoryType">The factory threading type.</param>
 /// <param name="debugLevel">The factory debug level.</param>
 public Factory2(FactoryType factoryType, DebugLevel debugLevel)
     : base(factoryType, debugLevel)
 {
 }
Example #37
0
 //获取游戏物体 对象池
 public GameObject GetGameObject(FactoryType type, string itemName)
 {
     return(factoryManager.factoryDict[type].GetItem(itemName));
 }
Example #38
0
 // 获取游戏物体的方法
 public GameObject GetItem(FactoryType factoryType, string itemName)
 {
     return(mGameManager.GetItem(factoryType, itemName));
 }
Example #39
0
 /// <summary>
 /// Creates a new instance of the <see cref="Factory2"/> class with the specified <see cref="FactoryType"/> and <see cref="DebugLevel"/>.
 /// </summary>
 /// <param name="factoryType">The factory threading type.</param>
 /// <param name="debugLevel">The factory debug level.</param>
 public Factory2(FactoryType factoryType, DebugLevel debugLevel)
     : base(factoryType, debugLevel)
 {
 }
Example #40
0
 /// <summary>
 /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory" />.
 /// </summary>
 public Factory(FactoryType factoryType)
     : this(factoryType, DebugLevel.None)
 {
 }
Example #41
0
 public CFactoryTest(FactoryType type)
 {
     m_pFactory = FactoryFactory.CreateFactory(type);
 }
Example #42
0
 public void Unregister(Type serviceType, object serviceKey, FactoryType factoryType,
                        Func <Factory, bool> condition)
 {
     throw new NotImplementedException();
 }
        private void CreateStation(FactoryType factoryType, string codename, int maxStack, LocalizedString name, LocalizedString desc, string guidString, Sprite icon, string variantname, RecipeCategory[] categories)
        {
            var category = GameResources.Instance.Items.FirstOrDefault(s => s.AssetId == productionStationGUID)?.Category;
            var item     = ScriptableObject.CreateInstance <ItemDefinition>();

            if (item == null)
            {
                Debug.Log("Item is null"); return;
            }
            if (category == null)
            {
                Debug.Log("Category is null"); return;
            }
            item.name     = codename;
            item.Category = category;
            item.MaxStack = maxStack;
            item.Icon     = icon;

            var prefabParent = new GameObject();
            var olditem      = GameResources.Instance.Items.FirstOrDefault(s => s.AssetId == productionStationGUID);

            prefabParent.SetActive(false);
            var newmodule = Instantiate(olditem.Prefabs[0], prefabParent.transform);
            var module    = newmodule.GetComponentInChildren <FactoryStation>();
            var producer  = newmodule.GetComponentInChildren <Producer>();

            newmodule.SetName("AlloyForgeStation");
            var gridmodule = newmodule.GetComponent <GridModule>();

            gridmodule.VariantName = variantname;
            gridmodule.Item        = item;

            var productionGroup = QuestingReferences.GetOrCreateTyping(factoryType);

            foreach (ProductionModule sleepersmodule in productionGroup.Modules)
            {
                using (StreamWriter writer = new StreamWriter(QuestingMod.path, true))
                {
                    writer.WriteLine("[Questing Update | Stations]: " + sleepersmodule.name);
                    writer.Dispose();
                }
            }

            LocalizedString nameStr = name;
            LocalizedString descStr = desc;

            Initialize(ref nameStr);
            Initialize(ref descStr);

            item.SetPrivateField("m_name", nameStr);
            item.SetPrivateField("m_description", descStr);
            typeof(FactoryStation).GetField("m_factoryType", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(module, factoryType);
            typeof(FactoryStation).GetField("m_productionGroup", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(module, productionGroup);
            typeof(Producer).GetField("m_categories", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(producer, categories);

            var guid = GUID.Parse(guidString);

            typeof(Definition).GetField("m_assetId", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(item, guid);

            item.Prefabs = new GameObject[] { newmodule };

            AssetReference[] assets = new AssetReference[] { new AssetReference()
                                                             {
                                                                 Object = item, Guid = guid, Labels = new string[0]
                                                             } };
            RuntimeAssetStorage.Add(assets, default);
        }
Example #44
0
 //获取游戏物体资源
 public GameObject GetGameObjectResource(FactoryType factoryType, string name)
 {
     return(factoryManager.factoryDict[factoryType].GetItem(name));
 }
Example #45
0
 //回收游戏物体到对象池
 public void PushGameObjectToFactory(FactoryType factoryType, string name, GameObject go)
 {
     factoryManager.factoryDict[factoryType].PushItem(name, go);
 }
 public FactoryMethodAttribute(FactoryType registerAs,InstanceMode instanceMode)
 {
     RegisterAs = registerAs;
     InstanceMode = instanceMode;
 }
Example #47
0
 /// <summary>
 /// Creates a new instance of the <see cref="Factory2"/> class with the specified <see cref="FactoryType"/>.
 /// </summary>
 /// <param name="factoryType">The factory threading type.</param>
 public Factory2(FactoryType factoryType)
     : base(factoryType)
 {
 }
Example #48
0
 /// <summary>
 /// Creates a new instance of the <see cref="Factory1"/> class.
 /// </summary>
 /// <param name="factoryType">The factory type.</param>
 public Factory1(FactoryType factoryType)
     : base(IntPtr.Zero)
 {
     DWrite.CreateFactory(factoryType, Utilities.GetGuidFromType(typeof(Factory1)), this);
 }
 /// <summary>
 /// Static constructor retrieves factory type from config.
 /// </summary>
 static OAuth2DataFactory()
 {
     factoryType = (FactoryType) OAuth2Config.OAuth2DataStoreType;
 }