private bool AreDataPresent(CategoryTypesEnum categoryType) { DateTime startDate = DateTime.Now.AddMonths(MONTHS_START); return(DbContext.Transactions.Any(item => item.Date >= startDate && item.Category.CategoryTypesId == (int)categoryType)); }
private int GenerateItems(CategoryTypesEnum itemCategory, string itemPrefix) { DateTime currentDate = DateTime.Now.AddMonths(MONTHS_START); DateTime endDate = DateTime.Now.AddMonths(MONTHS_END); Random categoriesRandomizer = new Random(); Random daysRandomizer = new Random(); Random amountRandomizer = new Random(); Random partnerRandomizer = new Random(); int nextItem = 1; int minPartner = DbContext.Partners.Min(item => item.Id); int maxPartner = DbContext.Partners.Max(item => item.Id); List <Models.Categories> incomeCategories = DbContext.Categories .Where(item => item.CategoryTypesId == (int)itemCategory).ToList(); while (currentDate <= endDate) { currentDate = currentDate.AddDays(daysRandomizer.Next(20, 90)); double amount = amountRandomizer.NextDouble() * 1000 + 100; int partnerId = partnerRandomizer.Next(minPartner, maxPartner); int categoryId = incomeCategories[categoriesRandomizer.Next(incomeCategories.Count - 1)].Id; Models.Item item = new Models.Item { CategoriesId = categoryId, DateAcquired = currentDate, Value = Convert.ToDecimal(Math.Round(amount, 2)), Name = itemPrefix + (nextItem++).ToString() }; DbContext.Items.Add(item); } return(DbContext.SaveChanges()); }
private int GenerateTransactions(CategoryTypesEnum transactionCategory) { DateTime currentDate = DateTime.Now.AddMonths(MONTHS_START); DateTime endDate = DateTime.Now.AddMonths(MONTHS_END); Random categoriesRandomizer = new Random(); Random daysRandomizer = new Random(); Random amountRandomizer = new Random(); Random partnerRandomizer = new Random(); int minPartner = DbContext.Partners.Min(item => item.Id); int maxPartner = DbContext.Partners.Max(item => item.Id); List <Models.Categories> incomeCategories = DbContext.Categories .Where(item => item.CategoryTypesId == (int)transactionCategory).ToList(); while (currentDate <= endDate) { currentDate = currentDate.AddDays(daysRandomizer.Next(5, 12)); double amount = amountRandomizer.NextDouble() * 400 + 20; int partnerId = partnerRandomizer.Next(minPartner, maxPartner); int categoryId = incomeCategories[categoriesRandomizer.Next(incomeCategories.Count - 1)].Id; Models.Transactions transaction = new Models.Transactions { CategoriesId = categoryId, Amount = Convert.ToDecimal(Math.Round(amount, 2)), Date = currentDate, PartnersId = partnerId }; DbContext.Transactions.Add(transaction); } return(DbContext.SaveChanges()); }
public PrefabTag(MyMwcObjectBuilderTypeEnum prefabModule, int prefabId, MyMwcObjectBuilder_Prefab_AppearanceEnum factionAppearance, CategoryTypesEnum categoryTypes) { PrefabModule = prefabModule; PrefabId = prefabId; FactionAppearance = factionAppearance; CategoryType = categoryTypes; }
private int GenerateItems(CategoryTypesEnum itemCategory, string itemPrefix) { DateTime currentDate = DateTime.Now.AddMonths(MONTHS_START); DateTime endDate = DateTime.Now.AddMonths(MONTHS_END); Random categoriesRandomizer = new Random(); Random daysRandomizer = new Random(); Random amountRandomizer = new Random(); Random partnerRandomizer = new Random(); int nextItem = 1; int minPartner = DbContext.Partners.Min(item => item.Id); int maxPartner = DbContext.Partners.Max(item => item.Id); List<Models.Categories> incomeCategories = DbContext.Categories .Where(item => item.CategoryTypesId == (int)itemCategory).ToList(); while (currentDate <= endDate) { currentDate = currentDate.AddDays(daysRandomizer.Next(20, 90)); double amount = amountRandomizer.NextDouble() * 1000 + 100; int partnerId = partnerRandomizer.Next(minPartner, maxPartner); int categoryId = incomeCategories[categoriesRandomizer.Next(incomeCategories.Count - 1)].Id; Models.Item item = new Models.Item { CategoriesId = categoryId, DateAcquired = currentDate, Value = Convert.ToDecimal(Math.Round(amount, 2)), Name = itemPrefix + (nextItem++).ToString() }; DbContext.Items.Add(item); } return DbContext.SaveChanges(); }
public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum? modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, requiresEnergy: false) { ModelLod0EnumOn = modelLod0EnumOn; ModelLod1EnumOn = modelLod1EnumOn; }
public MyPrefabConfigurationKinematicRotating(MyModelsEnum modelBaseLod0Enum, MyModelsEnum? modelBaseLod1Enum, MySoundCuesEnum? soundOpening, MySoundCuesEnum? soundLooping, MySoundCuesEnum? soundClosing, float rotatingVelocity, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType) : this(modelBaseLod0Enum, modelBaseLod1Enum, soundOpening, soundLooping, soundClosing, rotatingVelocity, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default) { }
public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MyModelsEnum? modelCol = null, float explosionParticleEffectScale = 1) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Generator, range, rotatingVelocity, MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum.Amb3D_GenXend, modelCol, explosionParticleEffectScale:explosionParticleEffectScale) { }
private static IQueryable <PersonalFinance.Models.Item> GetOwnedItems(DateTime startDate, DateTime endDate, CategoryTypesEnum assetType, PersonalFinanceContainer context) { return(from asset in context.Items.Include(item => item.Category) where (asset.Category.CategoryType.Id == (int)assetType && (asset.DateAcquired >= startDate) && asset.DateAcquired <= endDate) orderby asset.DateAcquired select asset); }
public static MyGuiPrefabCategoryTypeHelper GetMyGuiCategoryTypeHelper(CategoryTypesEnum categoryType) { MyGuiPrefabCategoryTypeHelper ret; if (m_categoryTypeHelpers.TryGetValue(categoryType, out ret)) return ret; else return null; }
public MyPrefabConfigurationKinematic(MyModelsEnum modelBaseLod0Enum, MyModelsEnum? modelBaseLod1Enum, List<MyPrefabConfigurationKinematicPart> kinematicParts, MySoundCuesEnum? soundOpening, MySoundCuesEnum? soundLooping, MySoundCuesEnum? soundClosing, float openTime, float closeTime, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyModelsEnum? collisionModelEnum = null) : this(modelBaseLod0Enum, modelBaseLod1Enum, kinematicParts, soundOpening, soundLooping, soundClosing, openTime, closeTime, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum) { }
public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MySoundCuesEnum? startRotatingCue = MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum? looptRotatingCue = MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum? endRotatingCue = MySoundCuesEnum.Amb3D_GenXend, MyModelsEnum? modelCol = null, float explosionParticleEffectScale = 1) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, minElectricCapacity: MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY, rotatingVelocity: rotatingVelocity, collisionModelEnum: modelCol, startRotatingCue: startRotatingCue, loopRotatingCue: looptRotatingCue, endRotatingCue: endRotatingCue, displayHud: true, explosionParticleEffectScale:explosionParticleEffectScale) { Range = range; }
/// <summary> /// Creates new instance of prefab configuration without model /// </summary> /// <param name="buildType">Build type</param> /// <param name="categoryType">Category type</param> /// <param name="subCategoryType">Subcategory type</param> /// <param name="materialType">Material type</param> /// <param name="prefabTypeFlag">Prefab type flags</param> /// <param name="factionSpecific">To which faction is this prefab specific. Null if prefab is for all factions. Used for material (texture) set availability. </param> /// <param name="previewPointOfView">Indicates whether the preview image for this prefab should be from a different angle than normal. Use for flat objects that have incorrect default previews (such as signs). </param> protected MyPrefabConfiguration( BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null, bool needsUpdate = false, bool initPhysics = true, bool enabledInEditor = true, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MySoundCuesEnum? startRotatingCue = null, MySoundCuesEnum? loopRotatingCue = null, MySoundCuesEnum? loopRotatingDamagedCue = null, MySoundCuesEnum? endRotatingCue = null, MyPreviewPointOfViewEnum previewPointOfView = MyPreviewPointOfViewEnum.Front, float minElectricCapacity = MyGameplayConstants.DEFAULT_MIN_ELECTRIC_CAPACITY, float maxElectricCapacity = MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION, float explosionRadiusMultiplier = 1.5f, float explosionDamageMultiplier = 1, float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS, bool causesAlarm = false, bool requiresEnergy = false, float explosionParticleEffectScale = 1, bool displayHud = false) { //m_modelLod0Enum = null; m_modelLod1Enum = null; BuildType = buildType; CategoryType = categoryType; SubCategoryType = subCategoryType; MaterialType = materialType; PrefabTypeFlag = prefabTypeFlag; FactionSpecific = factionSpecific; EnabledInEditor = enabledInEditor; RotatingVelocity = rotatingVelocity; StartRotatingCue = startRotatingCue; LoopRotatingCue = loopRotatingCue; LoopRotatingDamagedCue = loopRotatingDamagedCue; EndRotatingCue = endRotatingCue; PreviewPointOfView = new MyPreviewPointOfView(previewPointOfView); MinElectricCapacity = minElectricCapacity; MaxElectricCapacity = maxElectricCapacity; NeedsUpdate = needsUpdate; InitPhysics = initPhysics; ExplosionType = explosionType; ExplosionRadiusMultiplier = explosionRadiusMultiplier; ExplosionDamage = explosionDamageMultiplier; ExplosionParticleEffectScale = explosionParticleEffectScale; MinSizeForExplosion = minSizeForExplosion; CausesAlarm = causesAlarm; RequiresEnergy = requiresEnergy; DisplayHud = displayHud; }
public MyPrefabConfigurationKinematicRotating(MyModelsEnum modelBaseLod0Enum, MyModelsEnum? modelBaseLod1Enum, MySoundCuesEnum? soundOpening, MySoundCuesEnum? soundLooping, MySoundCuesEnum? soundClosing, float rotatingVelocity, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag) : base(modelBaseLod0Enum, modelBaseLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag) { SoundOpening = soundOpening; SoundLooping = soundLooping; SoundClosing = soundClosing; RotatingVelocity = rotatingVelocity; }
public MyPrefabConfigurationKinematicPart(int prefabId, MyModelsEnum modelMovingEnum, string open, string close, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, DamageTypesEnum damageType, MyModelsEnum?modelLod1 = null, MyModelsEnum?collisionModelEnum = null) : base(modelMovingEnum, modelLod1, buildType, categoryType, subCategoryType, materialType, //0.5 because of door parts, to not take also second part PrefabTypesFlagEnum.Default, needsUpdate: true, explosionRadiusMultiplier: 0.5f, explosionDamage: 0.33f, collisionModelEnum: collisionModelEnum, explosionParticleEffectScale: 2.0f) { m_modelMovingEnum = modelMovingEnum; m_open = open; m_close = close; m_damageType = damageType; PrefabId = prefabId; }
public MyPrefabConfigurationKinematicPart(int prefabId, MyModelsEnum modelMovingEnum, string open, string close, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, DamageTypesEnum damageType, MyModelsEnum? modelLod1 = null, MyModelsEnum? collisionModelEnum = null) : base(modelMovingEnum, modelLod1, buildType, categoryType, subCategoryType, materialType, //0.5 because of door parts, to not take also second part PrefabTypesFlagEnum.Default, needsUpdate: true, explosionRadiusMultiplier: 0.5f, explosionDamage: 0.33f, collisionModelEnum: collisionModelEnum, explosionParticleEffectScale: 2.0f) { m_modelMovingEnum = modelMovingEnum; m_open = open; m_close = close; m_damageType = damageType; PrefabId = prefabId; }
private static IQueryable <Transactions> GetSpending(DateTime startDate, DateTime endDate, CategoryTypesEnum categoryType, PersonalFinanceContainer context) { var transactions = context.Transactions .Include(table => table.Category) //.Include(table => table.Category.CategoryType) .Include(table => table.Partner); return(from transaction in transactions where (transaction.Category.CategoryTypesId == (int)categoryType) && (transaction.Date >= startDate && transaction.Date <= endDate) select transaction); }
public MyPrefabConfigurationKinematic(MyModelsEnum modelBaseLod0Enum, MyModelsEnum? modelBaseLod1Enum, List<MyPrefabConfigurationKinematicPart> kinematicParts, MySoundCuesEnum? soundOpening, MySoundCuesEnum? soundLooping, MySoundCuesEnum? soundClosing, float openTime, float closeTime, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum? collisionModelEnum = null) : base(modelBaseLod0Enum, modelBaseLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, collisionModelEnum: collisionModelEnum, displayHud: true) { m_openTime = openTime; m_closeTime = closeTime; KinematicParts = kinematicParts; m_soundOpening = soundOpening; m_soundLooping = soundLooping; m_soundClosing = soundClosing; }
private static IQueryable <CategorySummary> GetCategoriesSummaryItems(DateTime startDate, CategoryTypesEnum assetType, PersonalFinanceContainer context) { return(from category in context.Categories.Include(item => item.Items) where category.CategoryTypesId == (int)assetType && category.Items.Count() > 0 && category.Items.Any(item => item.DateAcquired >= startDate) select new CategorySummary { Id = category.Id, Name = category.Name, Total = category.Items.Sum(item => item.Value) }); }
public MyPrefabConfigurationLargeWeapon( BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyMwcObjectBuilder_PrefabLargeWeapon_TypesEnum weaponType, MyMwcObjectBuilder_Prefab_AppearanceEnum?factionSpecific = null, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION, float explosionRadiusMultiplier = 5, float explosionDamageMultiplier = 300) : base(buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, factionSpecific: factionSpecific, explosionType: explosionType, explosionRadiusMultiplier: explosionRadiusMultiplier, explosionDamageMultiplier: explosionDamageMultiplier, requiresEnergy: true, displayHud: true) { WeaponType = weaponType; }
private static IQueryable <CategorySummary> GetCategoriesSummary(DateTime startDate, DateTime endDate, CategoryTypesEnum categoryType, PersonalFinanceContainer context) { return(from category in context.Categories.Include(table => table.Transactions) where category.CategoryTypesId == (int)categoryType && category.Transactions.Count() > 0 && category.Transactions.Any(transaction => transaction.Date >= startDate && transaction.Date <= endDate) select new CategorySummary { Id = category.Id, Name = category.Name, Total = category.Transactions.Sum(tran => tran.Amount) }); }
public MyPrefabConfigurationLargeWeapon( BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyMwcObjectBuilder_PrefabLargeWeapon_TypesEnum weaponType, MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION, float explosionRadiusMultiplier = 5, float explosionDamageMultiplier = 300) : base(buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, factionSpecific: factionSpecific, explosionType: explosionType, explosionRadiusMultiplier: explosionRadiusMultiplier, explosionDamageMultiplier: explosionDamageMultiplier, requiresEnergy: true, displayHud: true) { WeaponType = weaponType; }
public MyPrefabConfigurationLargeShip( MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyMwcObjectBuilder_Prefab_AppearanceEnum?factionSpecific = null, MyModelsEnum?collisionModelEnum = null, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.BOMB_EXPLOSION, float particleScale = 1) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.LargeShip, factionSpecific: factionSpecific, needsUpdate: true, collisionModelEnum: collisionModelEnum, explosionType: explosionType, explosionParticleEffectScale: particleScale) { }
public MyPrefabConfigurationLargeShip( MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null, MyModelsEnum? collisionModelEnum = null, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.BOMB_EXPLOSION, float particleScale = 1) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.LargeShip, factionSpecific: factionSpecific, needsUpdate: true, collisionModelEnum: collisionModelEnum, explosionType: explosionType, explosionParticleEffectScale: particleScale) { }
private void RemoveUnsupportedEntities() { CategoryTypesEnum[] disabledCategories = new CategoryTypesEnum[] { //CategoryTypesEnum.DOORS, //CategoryTypesEnum.DOOR_CASES, //CategoryTypesEnum.ALARM, // Damage enabled, so barrels too //CategoryTypesEnum.BARRELS, //CategoryTypesEnum.BANK_NODE, //CategoryTypesEnum.CAMERA, //CategoryTypesEnum.FOUNDATION_FACTORY, //CategoryTypesEnum.SCANNER, //CategoryTypesEnum.SECURITY_CONTROL_HUB, }; Type[] disabledEntityTypes = new Type[] { }; foreach (var entity in MyEntities.GetEntities()) { if (IsEntityUnsupported(entity, disabledEntityTypes)) { entity.MarkForClose(); } else if (entity is MyPrefabContainer) { foreach (var e in ((MyPrefabContainer)entity).GetPrefabs()) { var category = ((MyPrefabBase)e).PrefabCategory; // We don't want indestructible doors and barrels, so close them if (disabledCategories.Contains(category)) { e.MarkForClose(); } // Damage enabled, prefabs are destructible //else //{ // e.IsDestructible = false; //} } } } }
/// <summary> /// Creates new instance of prefab configuration with default prefab type flags /// </summary> /// <param name="modelLod0Enum">Model LOD0</param> /// <param name="modelLod1Enum">Model LOD2</param> /// <param name="buildType">Build type</param> /// <param name="categoryType">Category type</param> /// <param name="subCategoryType">Subcategory type</param> /// <param name="materialType">Material type</param> /// <param name="factionSpecific">To which faction is this prefab specific. Null if prefab is for all factions. Used for material (texture) set availability. </param> public MyPrefabConfiguration( MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null, MyModelsEnum? collisionModelEnum = null, bool needsUpdate = false, bool initPhysics = true, bool enabledInEditor = true, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MySoundCuesEnum? startRotatingCue = null, MySoundCuesEnum? loopRotatingCue = null, MySoundCuesEnum? loopRotatingDamagedCue = null, MySoundCuesEnum? endRotatingCue = null, MyPreviewPointOfViewEnum previewAngle = MyPreviewPointOfViewEnum.Front, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION, float explosionRadiusMultiplier = 1, float explosionDamageMultiplier = 1, float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS, bool causesAlarm = false, bool requiresEnergy = false, float explosionParticleEffectScale = 1, bool displayHud = false) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum, factionSpecific, needsUpdate, initPhysics, enabledInEditor, rotatingVelocity, startRotatingCue, loopRotatingCue, loopRotatingDamagedCue, endRotatingCue, previewAngle, explosionType: explosionType, explosionRadiusMultiplier: explosionRadiusMultiplier, explosionDamage: explosionDamageMultiplier, minSizeForExplosion: minSizeForExplosion, causesAlarm: causesAlarm, requiresEnergy: requiresEnergy, explosionParticleEffectScale: explosionParticleEffectScale, displayHud: displayHud) { System.Diagnostics.Debug.Assert(modelLod0Enum != modelLod1Enum, "LOD0 and LOD1 models are the same!"); if (collisionModelEnum != null) { System.Diagnostics.Debug.Assert(modelLod0Enum != collisionModelEnum, "LOD0 and COL models are the same!"); System.Diagnostics.Debug.Assert(modelLod1Enum != collisionModelEnum, "LOD1 and COL models are the same!"); } }
/// <summary> /// Creates new instance of prefab configuration /// </summary> /// <param name="modelLod0Enum">Model LOD0</param> /// <param name="modelLod1Enum">Model LOD2</param> /// <param name="buildType">Build type</param> /// <param name="categoryType">Category type</param> /// <param name="subCategoryType">Subcategory type</param> /// <param name="materialType">Material type</param> /// <param name="prefabTypeFlag">Prefab type flags</param> protected MyPrefabConfiguration( MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum? collisionModelEnum = null, MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null, bool needsUpdate = false, bool initPhysics = true, bool enabledInEditor = true, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MySoundCuesEnum? startRotatingCue = null, MySoundCuesEnum? loopRotatingCue = null, MySoundCuesEnum? loopRotatingDamagedCue = null, MySoundCuesEnum? endRotatingCue = null, MyPreviewPointOfViewEnum previewAngle = MyPreviewPointOfViewEnum.Front, float minElectricCapacity = MyGameplayConstants.DEFAULT_MIN_ELECTRIC_CAPACITY, float maxElectricCapacity = MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY, MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION, float explosionRadiusMultiplier = 1, float explosionDamage = 1, float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS, bool causesAlarm = false, bool requiresEnergy = false, float explosionParticleEffectScale = 1, bool displayHud = false) : this(buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, factionSpecific, needsUpdate, initPhysics, enabledInEditor, rotatingVelocity, startRotatingCue, loopRotatingCue, loopRotatingDamagedCue, endRotatingCue, previewAngle, minElectricCapacity, maxElectricCapacity, explosionType, explosionRadiusMultiplier, explosionDamage, minSizeForExplosion, causesAlarm, requiresEnergy: requiresEnergy, explosionParticleEffectScale: explosionParticleEffectScale, displayHud: displayHud) { m_modelLod0Enum = modelLod0Enum; m_modelLod1Enum = modelLod1Enum; m_collisionModelEnum = collisionModelEnum; }
protected abstract void AddPrefabItems(MyTreeViewItem parentItem, MyMwcObjectBuilder_Prefab_AppearanceEnum appearanceTextureEnum, BuildTypesEnum buildType, CategoryTypesEnum categoryType);
protected void AddPrefabType(MyTreeViewItem parentItem, MyMwcObjectBuilder_Prefab_AppearanceEnum appearanceTextureEnum, MyTextsWrapperEnum typeText, BuildTypesEnum buildTypesEnum, CategoryTypesEnum[] categories, MyTexture2D icon, Vector2 iconSize, MyTexture2D expand, MyTexture2D collapse, Vector2 expandIconSize) { var prefabTypeItem = parentItem == null ? m_addObjectTreeView.AddItem(MyTextsWrapper.Get(typeText), icon, iconSize, expand, collapse, expandIconSize) : parentItem.AddItem(MyTextsWrapper.Get(typeText), icon, iconSize, expand, collapse, expandIconSize); foreach (var categoryTypesEnum in categories) { var categoryItem = prefabTypeItem.AddItem(MyGuiPrefabHelpers.GetMyGuiCategoryTypeHelper(categoryTypesEnum).Description, icon, iconSize, expand, collapse, expandIconSize); AddPrefabItems(categoryItem, appearanceTextureEnum, buildTypesEnum, categoryTypesEnum); } }
public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MyModelsEnum?modelCol = null, float explosionParticleEffectScale = 1) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Generator, range, rotatingVelocity, MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum.Amb3D_GenXend, modelCol, explosionParticleEffectScale : explosionParticleEffectScale) { }
public MyPrefabConfigurationSound(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MySoundCuesEnum sound) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, sound, PrefabTypesFlagEnum.Default) { }
private int GenerateTransactions(CategoryTypesEnum transactionCategory) { DateTime currentDate = DateTime.Now.AddMonths(MONTHS_START); DateTime endDate = DateTime.Now.AddMonths(MONTHS_END); Random categoriesRandomizer = new Random(); Random daysRandomizer = new Random(); Random amountRandomizer = new Random(); Random partnerRandomizer = new Random(); int minPartner = DbContext.Partners.Min(item => item.Id); int maxPartner = DbContext.Partners.Max(item => item.Id); List<Models.Categories> incomeCategories = DbContext.Categories .Where(item => item.CategoryTypesId == (int)transactionCategory).ToList(); while (currentDate <= endDate) { currentDate = currentDate.AddDays(daysRandomizer.Next(5, 12)); double amount = amountRandomizer.NextDouble() * 400 + 20; int partnerId = partnerRandomizer.Next(minPartner, maxPartner); int categoryId = incomeCategories[categoriesRandomizer.Next(incomeCategories.Count - 1)].Id; Models.Transactions transaction = new Models.Transactions { CategoriesId = categoryId, Amount = Convert.ToDecimal(Math.Round(amount, 2)), Date = currentDate, PartnersId = partnerId }; DbContext.Transactions.Add(transaction); } return DbContext.SaveChanges(); }
public MyPrefabConfigurationHangar(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyModelsEnum? collisionModel = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Hangar, collisionModel: collisionModel) { }
private static IQueryable<CategorySummary> GetCategoriesSummary(DateTime startDate, DateTime endDate, CategoryTypesEnum categoryType, PersonalFinanceContainer context) { return from category in context.Categories.Include(table => table.Transactions) where category.CategoryTypesId == (int)categoryType && category.Transactions.Count() > 0 && category.Transactions.Any(transaction => transaction.Date >= startDate && transaction.Date <= endDate) select new CategorySummary { Id = category.Id, Name = category.Name, Total = category.Transactions.Sum(tran => tran.Amount) }; }
public MyPrefabConfigurationScanner(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Scanner) { }
public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum?modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType) : this(modelLod0Enum, modelLod1Enum, modelLod0EnumOn, modelLod1EnumOn, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Alarm) { }
public MyPrefabConfigurationLight(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyLightPrefabTypeEnum type, PrefabTypesFlagEnum prefabTypesFlag, MyModelsEnum?collisionModelEnum = null) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypesFlag, previewAngle: MyPreviewPointOfViewEnum.Bottom, needsUpdate: true, collisionModelEnum: collisionModelEnum) { LightType = type; }
protected abstract void AddPrefabItems(MyTreeViewItem parentItem, MyMwcObjectBuilder_Prefab_AppearanceEnum appearanceTextureEnum, BuildTypesEnum buildType, CategoryTypesEnum categoryType);
private static IQueryable<PersonalFinance.Models.Item> GetOwnedItems(DateTime startDate, DateTime endDate, CategoryTypesEnum assetType, PersonalFinanceContainer context) { return from asset in context.Items.Include(item => item.Category) where (asset.Category.CategoryType.Id == (int)assetType && (asset.DateAcquired >= startDate) && asset.DateAcquired <= endDate) orderby asset.DateAcquired select asset; }
public MyPrefabConfigurationFoundationFactory(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyModelsEnum? collisionModelEnum = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.FoundationFactory, collisionModelEnum) { }
public MyPrefabConfigurationFoundationFactory(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModelEnum = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.FoundationFactory, collisionModelEnum) { }
public MyPrefabConfigurationHangar(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum? collisionModel = null) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, displayHud: true, collisionModelEnum: collisionModel) { }
public MyPrefabConfigurationLight(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyLightPrefabTypeEnum type, MyModelsEnum? collisionModelEnum = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, type, PrefabTypesFlagEnum.Default, collisionModelEnum) { }
private bool AreDataPresent(CategoryTypesEnum categoryType) { DateTime startDate = DateTime.Now.AddMonths(MONTHS_START); return DbContext.Transactions.Any(item => item.Date >= startDate && item.Category.CategoryTypesId == (int)categoryType); }
public MyPrefabConfigurationHangar(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModel = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Hangar, collisionModel : collisionModel) { }
public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum?modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, requiresEnergy: false) { ModelLod0EnumOn = modelLod0EnumOn; ModelLod1EnumOn = modelLod1EnumOn; }
public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MySoundCuesEnum?startRotatingCue = MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum?looptRotatingCue = MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum?endRotatingCue = MySoundCuesEnum.Amb3D_GenXend, MyModelsEnum?modelCol = null, float explosionParticleEffectScale = 1) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, minElectricCapacity : MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY, rotatingVelocity : rotatingVelocity, collisionModelEnum : modelCol, startRotatingCue : startRotatingCue, loopRotatingCue : looptRotatingCue, endRotatingCue : endRotatingCue, displayHud : true, explosionParticleEffectScale : explosionParticleEffectScale) { Range = range; }
public MyPrefabConfigurationScanner(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, initPhysics: false, requiresEnergy: true) { }
public MyPrefabConfigurationCamera(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, requiresEnergy: true) { }
private static IQueryable<CategorySummary> GetCategoriesSummaryItems(DateTime startDate, CategoryTypesEnum assetType, PersonalFinanceContainer context) { return from category in context.Categories.Include(item => item.Items) where category.CategoryTypesId == (int)assetType && category.Items.Count() > 0 && category.Items.Any(item => item.DateAcquired >= startDate) select new CategorySummary { Id = category.Id, Name = category.Name, Total = category.Items.Sum(item => item.Value) }; }
protected override void AddPrefabItems(MyTreeViewItem parentItem, MyMwcObjectBuilder_Prefab_AppearanceEnum appearanceTextureEnum, BuildTypesEnum buildType, CategoryTypesEnum categoryType) { MyMwcLog.WriteLine("GOD AddPrefabItems - START"); Vector2 itemSize = MyGuiConstants.CHECKBOX_SIZE * 3; foreach (MyMwcObjectBuilderTypeEnum enumValue in MyGuiPrefabHelpers.MyMwcPrefabTypesEnumValues) { foreach (int prefabId in MyMwcObjectBuilder_Base.GetObjectBuilderIDs(enumValue)) { MyPrefabConfiguration config = MyPrefabConstants.GetPrefabConfiguration(enumValue, prefabId); MyGuiPrefabHelper prefabModuleHelper = MyGuiObjectBuilderHelpers.GetGuiHelper(enumValue, prefabId) as MyGuiPrefabHelper; if (config == null) continue; if (config.FactionSpecific.HasValue && config.FactionSpecific.Value != appearanceTextureEnum) continue; if (config.BuildType == buildType && config.CategoryType == categoryType && config.EnabledInEditor) { MyTexture2D previewTexture = MyGuiManager.GetPrefabPreviewTexture(enumValue, prefabId, appearanceTextureEnum); var item = parentItem.AddItem(new StringBuilder(), previewTexture, itemSize, MyGuiManager.GetBlankTexture(), MyGuiManager.GetBlankTexture(), MyGuiConstants.CHECKBOX_SIZE); item.ToolTip = GetPrefabToolTip(prefabModuleHelper.Description, config); //item.ToolTip = new MyToolTips(prefabModuleHelper.Description); item.Tag = new PrefabTag(enumValue, prefabId, appearanceTextureEnum, categoryType); item.Action = OnAddPrefab; item.DragDrop = m_addObjectTreeViewdragDrop; } } } MyMwcLog.WriteLine("GOD AddPrefabItems - END"); }
private static IQueryable<Transactions> GetSpending(DateTime startDate, DateTime endDate, CategoryTypesEnum categoryType, PersonalFinanceContainer context) { var transactions = context.Transactions .Include(table => table.Category) //.Include(table => table.Category.CategoryType) .Include(table => table.Partner); return from transaction in transactions where (transaction.Category.CategoryTypesId == (int)categoryType) && (transaction.Date >= startDate && transaction.Date <= endDate) select transaction; }
public List <MyPrefabBase> GetPrefabs(CategoryTypesEnum prefabCategory) { return(m_prefabsByCategory[(int)prefabCategory]); }
public MyPrefabConfigurationFoundationFactory(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum?collisionModelEnum = null) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, displayHud: true, collisionModelEnum: collisionModelEnum) { }
public MyPrefabConfigurationSecurityControlHUB(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModelEnum = null) : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum) { }
public MyPrefabConfigurationLight(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, MyLightPrefabTypeEnum type, PrefabTypesFlagEnum prefabTypesFlag, MyModelsEnum? collisionModelEnum = null) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypesFlag, previewAngle: MyPreviewPointOfViewEnum.Bottom, needsUpdate: true, collisionModelEnum: collisionModelEnum) { LightType = type; }
public MyPrefabConfigurationSecurityControlHUB(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum?collisionModelEnum = null) : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, requiresEnergy: true, collisionModelEnum: collisionModelEnum, displayHud: true) { }