/// <summary> /// Retrieves an existing entity type, or creates a new one if no matching entity type is found. /// </summary> /// <param name="entityTypeName">Entity type name.</param> /// <param name="baseType">Base type that this entity type will inherit from if creating a new type.</param> /// <returns>A ModelEntityType object.</returns> public ModelEntityType GetOrCreateEntityType(string entityTypeName, ModelEntityType baseType) { try { ModelEntityType modelEntityType = EntityTypes.FirstOrDefault(et => et.Name.Equals(entityTypeName)); if (modelEntityType == null) { modelEntityType = AddEntityType(entityTypeName, baseType); } return(modelEntityType); } catch (Exception ex) { try { if (!ex.Data.Contains("EDMXType")) { ex.Data.Add("EDMXType", this.GetType().Name); } if (!ex.Data.Contains("EDMXObjectName")) { ex.Data.Add("EDMXObjectName", this.ContainerName); } } catch { } throw; } }
/// <summary> /// Adds a function import to the model. /// </summary> /// <param name="name"></param> /// <returns></returns> public ModelFunction AddFunctionImport(string name) { try { if (!EntityTypes.Any(et => et.Name == name) && !FunctionImports.Any(mf => mf.Name == name)) { ModelFunction mf = new ModelFunction(ParentFile, this, name); _modelFunctionImports.Add(name, mf); mf.NameChanged += new EventHandler <NameChangeArgs>(mf_NameChanged); mf.Removed += new EventHandler(mf_Removed); return(mf); } else { throw new ArgumentException("A function with the name " + name + " already exist in the model."); } } catch (Exception ex) { try { if (!ex.Data.Contains("EDMXType")) { ex.Data.Add("EDMXType", this.GetType().Name); } if (!ex.Data.Contains("EDMXObjectName")) { ex.Data.Add("EDMXObjectName", this.ContainerName); } } catch { } throw; } }
private void AddConstructors() { Add(Tab(2), string.Format("public {0}{1}Context", Settings.Domain, SchemaCamelCased)); Add(Tab(2), "("); EntityTypes.Each(e => { var entityName = Pass.Code.Escape(e); var entityNamePluralized = Pluralize(entityName).LowerCaseFirstCharacter(); var format = !Settings.IsIncludePrimaryKey ? "Lazy<IRepositoryOrmId<{0}, {1}>> {2}," : "Lazy<IRepositoryOrm<{0}>> {2},"; Add(Tab(3), string.Format(format, entityName, GetPrimaryKeyType(e), entityNamePluralized)); }); Container.Remove(Container.Length - 3, 1); Add(Tab(2), ")"); Add(Tab(2), "{"); EntityTypes.Each(e => { var entityNamePluralized = Pluralize(Pass.Code.Escape(e)); var entityNamePluralizedLowered = entityNamePluralized.LowerCaseFirstCharacter(); Add(Tab(3), string.Format("Lazy{0} = {1};", entityNamePluralized, entityNamePluralizedLowered)); }); Add(Tab(2), "}"); }
public Entity GetEntityByName(string entityTypeName, string entityName) { var rt = EntityTypes.Single(x => x.Name == entityTypeName); var result = _cacheDao.GetEntityByName(rt.Id, entityName); return(result ?? Entity.GetNullEntity(rt.Id)); }
void LoadEntityType(XmlElement et, string ns) { var e = new EntityTypeInfo { Name = et.GetAttribute("Name").Trim(), Namespace = ns }; foreach (var p in et.ElementsWithName("Property")) { var prop = new EntityPropertyInfo { Name = p.GetAttribute("Name").Trim(), TypeFullName = p.GetAttribute("Type").Trim(), IsKey = false }; e.Properties.Add(prop); } foreach (var key in et.ElementsWithName("Key")) { foreach (var p in key.ElementsWithName("PropertyRef")) { var name = p.GetAttribute("Name").Trim(); foreach (var prop in e.Properties) { if (prop.Name == name) { prop.IsKey = true; } } } } EntityTypes.Add(e); }
public CharClass(AttackTypes style, CharTypes classe, RaceTypes race, EntityTypes type, string name, string description, float attackPower, float defensePower, float attackSpeed, float attackRange, float moveSpeed, float maxHealth, float maxMana ) { this.style = style; this.classe = classe; this.race = race; this.type = type; this.attackPower = attackPower; this.defensePower = defensePower; this.attackSpeed = attackSpeed; this.attackRange = attackRange; this.moveSpeed = moveSpeed; this.maxHealth = maxHealth; this.maxMana = maxMana; this.name = name; this.description = description; }
public static string GetDrawDate(EntityTypes type, string period) { if (type == EntityTypes.Luckyme) { if (period == "daily") { return(DateTime.Now.DailyStakeEndDate().ToLongDateString()); } else if (period == "weekly") { return(DateTime.Now.EndOfWeek(18, 0, 0, 0).ToLongDateString()); } else if (period == "monthly") { return(DateTime.Now.EndOfMonth(18, 0, 0, 0).ToLongDateString()); } } else if (type == EntityTypes.Business) { return(DateTime.Now.EndOfMonth(18, 0, 0, 0).ToLongDateString()); } else if (type == EntityTypes.Scholarship) { return(DateTime.Now.NextQuater(18, 0, 0, 0).ToLongDateString()); } return(null); }
public override async Task <IEnumerable <Entity> > RecognizeEntitiesAsync(DialogContext dialogContext, string text, string locale, IEnumerable <Entity> entities, CancellationToken cancellationToken = default) { List <Entity> newEntities = new List <Entity>(); var em = await GetEntityMap(dialogContext); if (entities != null) { var entityTypes = EntityTypes.GetValue(dialogContext); foreach (JObject entity in entities.Where(e => entityTypes.Contains(e.Type)).Select(e => JObject.FromObject(e, Serializer))) { text = ObjectPath.GetPathValue <string>(entity, "text"); if (!string.IsNullOrEmpty(text)) { var tokens = TokenUtils.GetTokens(text); foreach (var token in tokens) { if (em.TryGetValue(token.Text, out JObject result)) { dynamic newEntity = result.DeepClone(); newEntity.text = token.Text; newEntity.start = token.StartOffset; newEntity.end = token.EndOffset; newEntity.source = entity; newEntities.Add(((JObject)newEntity).ToObject <Entity>()); } } } } } return(newEntities); }
public EntityAttackPacket(Guid id, EntityTypes type, Guid mapId, int attackTimer) { Id = id; Type = type; MapId = mapId; AttackTimer = attackTimer; }
/// <summary> /// Helper to relink caster type and ID back to a real DaggerfallEntityBehaviour in scene. /// May experience concurrency issues once enemies start casting spells as very likely that /// player will save while under effect of a bundle cast by an enemy monster. /// Likewise possible for monster A and monster B to both catch each other in their AOEs and /// have a co-depdendency on each other as caster. So the first monster loaded will not be /// able to find reference for second monster as it has not been loaded yet. /// Already have strategies in mind to resolve this, depending on how bad problem is in practice. /// Don't want to "prematurely optimise" until this is actually a problem worth fixing. /// </summary> DaggerfallEntityBehaviour GetCasterReference(EntityTypes entityType, ulong loadID) { DaggerfallEntityBehaviour caster = null; // Only supporting player and enemy entity types as casters for now if (entityType == EntityTypes.Player) { caster = GameManager.Instance.PlayerEntityBehaviour; } else if ((entityType == EntityTypes.EnemyMonster || entityType == EntityTypes.EnemyClass) && loadID != 0) { SerializableEnemy serializableEnemy = SaveLoadManager.StateManager.GetEnemy(loadID); if (!serializableEnemy) { throw new Exception(string.Format("EntityEffect.RestoreEffectSaveData() could not find SerializableEnemy for LoadID {0} in StateManager.", loadID)); } caster = serializableEnemy.GetComponent <DaggerfallEntityBehaviour>(); if (!caster) { throw new Exception(string.Format("EntityEffect.RestoreEffectSaveData() could not find DaggerfallEntityBehaviour for LoadID {0} in StateManager.", loadID)); } } return(caster); }
public async Task <EntityTypes> GetAllAsync() { EntityTypes entityTypes = null; try { _projectContext.Load(_projectContext.EntityTypes); await _projectContext.ExecuteQueryAsync(); _projectContext.Load(_projectContext.EntityTypes.ProjectEntity); _projectContext.Load(_projectContext.EntityTypes.TaskEntity); _projectContext.Load(_projectContext.EntityTypes.ResourceEntity); await _projectContext.ExecuteQueryAsync(); entityTypes = _projectContext.EntityTypes; } catch (Exception ex) { // TODO: LOG ERROR! throw new CsomClientException($"Unexcepted error getting entity types. " + $"Project context url is {_projectContext.Url}.", ex); } return(entityTypes); }
public Entity Build(EntityTypes Type, Vector2 Position) { switch (Type) { case EntityTypes.e_spore: return(new Spore(Position, "Primitives\\Square", EntityTypes.e_spore) as Entity); // Create Flora Entity; case EntityTypes.e_flora: return(new Plant(Position, "Primitives\\Square", EntityTypes.e_flora) as Entity); // Create Predator Entity: case EntityTypes.e_predator: return(null); // Create Prey Entity case EntityTypes.e_prey: return(null); // Create Base Entity case EntityTypes.e_baseEntity: return(new Entity(Position, "Primitives\\Square", EntityTypes.e_baseEntity) as Entity); // Null default: return(null); } }
protected void Page_Load(object sender, EventArgs e) { if (Tile == null) return; _level = SessionObject.LCOrole; _lcos = (List<Thinkgate.Base.Classes.LCO>)Tile.TileParms.GetParm("lcos"); _userID = SessionObject.LoggedInUser.Page; // Simulate IsPostBack. String postBackControlID = GetControlThatCausedPostBack(Parent.Page); _isPostBack = !String.IsNullOrEmpty(postBackControlID) && !postBackControlID.StartsWith("folder") && !postBackControlID.StartsWith("tileContainer"); if (ViewState[_subjectFilterKey] == null) { ViewState.Add(_subjectFilterKey, "All"); ViewState.Add(_LEAFilterKey, "All"); } SetControlVisibility(); if (!_isPostBack) { BuildSubjects(); BuildLEAs(); } BuildPendingLCO(); }
//Get the count of current dummies in a category public int CurrentDummyParticipantsCount(EntityTypes entityTypes, Period?period) { switch (entityTypes) { case EntityTypes.Luckyme: if (period == Period.Daily) { return(DailyDummyLuckymeParticipants().Count()); } if (period == Period.Weekly) { return(WeeklyDummyLuckymeParticipants().Count()); } if (period == Period.Monthly) { return(MonthlyDummyLuckymeParticipants().Count()); } break; case EntityTypes.Business: return(DummyBusinessParticipants().Count()); break; case EntityTypes.Scholarship: return(DummyScholarshipParticipants().Count()); break; default: break; } return(0); }
/// <summary> /// Sets the ItemAction's properties based on the item it has. /// <para>The default behavior is to check the item's properties and set its MoveInfo, DamageInfo, and HealingInfo accordingly.</para> /// </summary> protected virtual void SetActionProperties() { Name = ItemUsed.Name; //NOTE: Refactor and make cleaner in some way IHPHealingItem hpHealing = ItemUsed as IHPHealingItem; IFPHealingItem fpHealing = ItemUsed as IFPHealingItem; IDamagingItem damageItem = ItemUsed as IDamagingItem; IStatusHealingItem statusHealing = ItemUsed as IStatusHealingItem; IStatusInflictingItem statusInflicting = ItemUsed as IStatusInflictingItem; IDamageEffectItem damageEffectItem = ItemUsed as IDamageEffectItem; EntityTypes[] otherEntityTypes = ItemUsed.OtherEntTypes; //Check if we should replace all instances of Enemy EntityTypes with opposing ones if (ItemUsed.GetOpposingIfEnemy == true && otherEntityTypes != null && otherEntityTypes.Length > 0) { //Create a new array so we don't modify the item's information otherEntityTypes = new EntityTypes[ItemUsed.OtherEntTypes.Length]; for (int i = 0; i < ItemUsed.OtherEntTypes.Length; i++) { EntityTypes entitytype = ItemUsed.OtherEntTypes[i]; //If we found Enemy, change it if (entitytype == EntityTypes.Enemy) { entitytype = User.GetOpposingEntityType(); } //Set the value otherEntityTypes[i] = entitytype; } } MoveInfo = new MoveActionData(ItemUsed.Icon, ItemUsed.Description, MoveResourceTypes.FP, 0, CostDisplayTypes.Hidden, ItemUsed.MoveAffectionType, ItemUsed.SelectionType, false, ItemUsed.HeightsAffected, otherEntityTypes); //Set the damage data if (damageItem != null || statusInflicting != null) { int damage = damageItem != null ? damageItem.Damage : 0; Elements element = damageItem != null ? damageItem.Element : Elements.Normal; StatusChanceHolder[] statuses = statusInflicting != null ? statusInflicting.StatusesInflicted : null; DamageEffects damageEffects = damageEffectItem != null ? damageEffectItem.InducedDamageEffects : DamageEffects.None; DamageInfo = new DamageData(damage, element, true, ContactTypes.None, ContactProperties.Ranged, statuses, damageEffects); } //Set the healing data if (hpHealing != null || fpHealing != null || statusHealing != null) { int hpHealed = hpHealing != null ? hpHealing.HPRestored : 0; int fpHealed = fpHealing != null ? fpHealing.FPRestored : 0; StatusTypes[] statusesHealed = statusHealing != null ? statusHealing.StatusesHealed : null; HealingInfo = new HealingData(hpHealed, fpHealed, statusesHealed); } }
public Entity(EntityTypes type, int key) { Type = type; BusinessKey = key; Name = ""; Parent = null; }
public List<EntityType> Get(EntityTypes request) { EntityTypeRepository repository = GetEntityTypeRepository(); List<EntityTypeEntity> entities = repository.Read(); return entities.TranslateToResponse(); }
//get a dictionary with key: entity type and value: list of selected instances of that type: public Dictionary <string, List <Entity> > GetEntitiesDictionary(EntityTypes type, bool exclusive, bool playerFaction) { Dictionary <string, List <Entity> > entities = new Dictionary <string, List <Entity> >(); foreach (string code in selectedDic.Keys) //get all the entity codes (keys) stored in the selected dictionary { Entity entity = selectedDic[code][0]; //get the first selected entity of the current type if (entity as FactionEntity != null) //there's a faction entity component { if (playerFaction && (entity as FactionEntity).FactionID != GameManager.PlayerFactionID) //if we requested player faction units only and this entity doesn't belong to player's faction { continue; } } if (type == EntityTypes.none || entity.Type == type) //if this matches the type we're looking for { entities.Add(code, selectedDic[code]); continue; } if (exclusive == true) //the entity is not a unit, return an empty list { continue; } } return(entities); }
public Entity(Resources resources, EntityTypes type) { _resources = resources; State = EntityStates.Idle; Type = type; SetDefaultAnimation(); }
public static DetailsViewModel Invoke(EntityTypes entityType, string id) { IMedia result = null; if (entityType == EntityTypes.Movies) { result = _movieManagementService.GetById(id); } if (entityType == EntityTypes.Songs) { result = _songManagementService.GetById(id); } if (entityType == EntityTypes.Books) { result = _bookManagementService.GetById(id); } return(new DetailsViewModel { FullSizeImagePath = result.FullSizeImagePath, Name = result.Name, ReleaseDate = result.ReleaseDate, StreamingUrl = result.StreamingUrl, CoverArtistDisplayName = result.CoverArtistDisplayName, Genre = result.Genre }); }
public EntityViewModel(EntityTypes type, int id, bool showTasks, bool showHistory) { Type = type; Id = id; ShowTasks = showTasks; ShowHistory = showHistory; }
//Flags are stored differently internally between Freelancer and Librelancer ThnObjectFlags ConvertFlags(EntityTypes type, LuaTable table) { var val = (int)(float)table["flags"]; if (val == 0) { return(ThnObjectFlags.None); } if (val == 1) { return(ThnObjectFlags.Reference); //Should be for all types } if (type == EntityTypes.Sound) { switch (val) { case 2: return(ThnObjectFlags.Spatial); default: throw new NotImplementedException(); } } return(ThnEnum.FlagsReflected <ThnObjectFlags>(val)); }
public static string GetStakedUserSmsMessage(EntityTypes entityType, Period?period, decimal amount) { string drawDate = null; switch (period) { case Period.Daily: drawDate = (getDateString(DateTime.Now.DailyStakeEndDate())); break; case Period.Monthly: drawDate = (getDateString(DateTime.Now.EndOfWeek(18, 0, 0, 0))); break; case Period.Weekly: drawDate = (getDateString(DateTime.Now.EndOfMonth(18, 0, 0, 0))); break; case Period.Quaterly: drawDate = (getDateString(DateTime.Now.NextQuater(18, 0, 0, 0))); break; default: break; } return($"You have successfully made a {period.ToString()} {entityType.ToString()} " + $"ntoboa of {amount.ToString("0.##")} cedi(s), your draw will happen on {drawDate}." + $" Stay tuned."); }
public EntityDirectionPacket(Guid id, EntityTypes type, Guid mapId, byte direction) { Id = id; Type = type; MapId = mapId; Direction = direction; }
public SearchResults(DataTable results, EntityTypes typeOfData) { InitializeComponent(); this.results = results; this.typeOfData = typeOfData; }
/// <summary> /// Returns all entities of a specified type in an array. /// The entities are returned in reverse order. Entities in the back are the first elements in the array. /// </summary> /// <param name="entityType">The type of entities to return.</param> /// <param name="heightStates">The height states to filter entities by. Entities with any of the state will be included. /// If null, will include entities of all height states.</param> /// <returns>Entities matching the type and height states specified, in reverse.</returns> public BattleEntity[] GetEntitiesReversed(EntityTypes entityType, params HeightStates[] heightStates) { List <BattleEntity> entities = GetEntitiesList(entityType, heightStates); entities.Reverse(); return(entities.ToArray()); }
public void FixupRelationships() { var additionalBehaviors = AdditionalBehaviors.ToDictionary(x => x.Id); var entityTypes = EntityTypes.ToDictionary(x => x.Id); var dataTypes = DataTypes.ToDictionary(x => x.Id); var entityTypeFacetDefaultValues = EntityTypeFacetDefaultValues.ToDictionary(x => x.Id); var entityTypeFacetDefinitions = EntityTypeFacetDefinitions.ToDictionary(x => x.Id); var entityTypeFacetValues = EntityTypeFacetValues.ToDictionary(x => x.Id); var entityTypeGeneralUsageCategories = EntityTypeGeneralUsageCategories.ToDictionary(x => x.Id); var enumTypes = EnumTypes.ToDictionary(x => x.Id); var enumValues = EnumValues.ToDictionary(x => x.Id); var expressionDefinitions = ExpressionDefinitions.ToDictionary(x => x.Id); var expressionBodies = ExpressionBodies.ToDictionary(x => x.Id); var facetTypes = FacetTypes.ToDictionary(x => x.Id); var properties = Properties.ToDictionary(x => x.Id); var propertyBehaviors = PropertyBehaviors.ToDictionary(x => x.Id); var propertyFacetDefaultValues = PropertyFacetDefaultValues.ToDictionary(x => x.Id); var propertyFacetDefinitions = PropertyFacetDefinitions.ToDictionary(x => x.Id); var propertyFacetValues = PropertyFacetValues.ToDictionary(x => x.Id); var propertyGeneralUsageCategories = PropertyGeneralUsageCategories.ToDictionary(x => x.Id); Fixup(PropertyFacetValues, properties, nameof(PropertyFacetValue.PropertyId), nameof(PropertyFacetValue.Property), nameof(Property.PropertyFacetValues)); Fixup(PropertyFacetValues, propertyFacetDefinitions, nameof(PropertyFacetValue.FacetDefinitionId), nameof(PropertyFacetValue.FacetDefinition)); Fixup(PropertyFacetDefinitions, facetTypes, nameof(PropertyFacetDefinition.FacetTypeId), nameof(PropertyFacetDefinition.FacetType)); Fixup(PropertyFacetDefinitions, enumTypes, nameof(PropertyFacetDefinition.EnumTypeId), nameof(PropertyFacetDefinition.EnumType)); Fixup(PropertyFacetDefaultValues, propertyFacetDefinitions, nameof(PropertyFacetDefaultValue.FacetDefinitionId), nameof(PropertyFacetDefaultValue.FacetDefinition)); Fixup(PropertyFacetDefaultValues, propertyGeneralUsageCategories, nameof(PropertyFacetDefaultValue.GeneralUsageCategoryId), nameof(PropertyFacetDefaultValue.GeneralUsageCategory)); Fixup(Properties, entityTypes, nameof(Property.OwnerEntityTypeId), nameof(Property.OwnerEntityType), nameof(EntityType.Properties)); Fixup(Properties, propertyGeneralUsageCategories, nameof(Property.GeneralUsageCategoryId), nameof(Property.GeneralUsageCategory)); Fixup(Properties, dataTypes, nameof(Property.DataTypeId), nameof(Property.DataType)); Fixup(Properties, expressionDefinitions, nameof(Property.ExpressionDefinitionId), nameof(Property.ExpressionDefinition)); Fixup(Properties, entityTypes, nameof(Property.DataEntityTypeId), nameof(Property.DataEntityType)); Fixup(Properties, properties, nameof(Property.ForeignKeyPropertyId), nameof(Property.ForeignKeyProperty), nameof(Property.Unused1)); Fixup(Properties, properties, nameof(Property.InversePropertyId), nameof(Property.InverseProperty), nameof(Property.Unused2)); Fixup(PropertyBehaviors, properties, nameof(PropertyBehavior.PropertyId), nameof(PropertyBehavior.Property), nameof(Property.PropertyBehaviors)); Fixup(PropertyBehaviors, additionalBehaviors, nameof(PropertyBehavior.AdditionalBehaviorId), nameof(PropertyBehavior.AdditionalBehavior)); Fixup(ExpressionDefinitions, entityTypes, nameof(ExpressionDefinition.MainInputEntityTypeId), nameof(ExpressionDefinition.MainInputEntityType)); Fixup(ExpressionDefinitions, expressionBodies, nameof(ExpressionDefinition.ActiveBodyId), nameof(ExpressionDefinition.ActiveBody)); Fixup(ExpressionBodies, expressionDefinitions, nameof(ExpressionBody.DefinitionId), nameof(ExpressionBody.Definition), nameof(ExpressionDefinition.Bodies)); Fixup(EnumValues, enumTypes, nameof(EnumValue.EnumTypeId), nameof(EnumValue.EnumType), nameof(EnumType.Values)); Fixup(EntityTypes, entityTypeGeneralUsageCategories, nameof(EntityType.GeneralUsageCategoryId), nameof(EntityType.GeneralUsageCategory)); Fixup(EntityTypes, entityTypes, nameof(EntityType.BaseEntityTypeId), nameof(EntityType.BaseEntityType)); Fixup(EntityTypeFacetValues, entityTypes, nameof(EntityTypeFacetValue.EntityTypeId), nameof(EntityTypeFacetValue.EntityType), nameof(EntityType.FacetValues)); Fixup(EntityTypeFacetValues, entityTypeFacetDefinitions, nameof(EntityTypeFacetValue.FacetDefinitionId), nameof(EntityTypeFacetValue.FacetDefinition)); Fixup(EntityTypeFacetDefinitions, facetTypes, nameof(EntityTypeFacetDefinition.FacetTypeId), nameof(EntityTypeFacetDefinition.FacetType)); Fixup(EntityTypeFacetDefinitions, enumTypes, nameof(EntityTypeFacetDefinition.EnumTypeId), nameof(EntityTypeFacetDefinition.EnumType)); Fixup(EntityTypeFacetDefaultValues, entityTypeFacetDefinitions, nameof(EntityTypeFacetDefaultValue.FacetDefinitionId), nameof(EntityTypeFacetDefaultValue.FacetDefinition)); Fixup(EntityTypeFacetDefaultValues, entityTypeGeneralUsageCategories, nameof(EntityTypeFacetDefaultValue.GeneralUsageCategoryId), nameof(EntityTypeFacetDefaultValue.GeneralUsageCategory)); }
// GET: entity_note/Create public ActionResult Create(string etn_entity_key, EntityTypes entity_type) { ViewBag.IsSignOutNotes = entity_type == EntityTypes.SignOutNotes; ViewBag.etn_ntt_key = _entityNoteService.GetAll() .Select(m => new SelectListItem { Text = m.ucd_title, Value = m.ucd_key.ToString() }); var noteTypeKey = 0; var nt = _uCLService.GetDefault(UclTypes.NoteType); if (nt != null) { noteTypeKey = nt.ucd_key; } if (Request.IsAjaxRequest()) { return(PartialView(new entity_note { etn_is_active = true, etn_entity_key = etn_entity_key, etn_ent_key = entity_type.ToInt(), etn_ntt_key = noteTypeKey })); } else { return(View(new entity_note { etn_is_active = true, etn_entity_key = etn_entity_key, etn_ent_key = entity_type.ToInt() })); } }
public Squirtle(string name) : base(name) { EntityTypes = new EntityTypes(Typings.Water, Typings.None); IVs = new IVS(1); }
public LoadContext(Deserializer deserializer, BlockTypes blockTypes, EntityTypes entityTypes, ItemTypes itemTypes) { BlockTypes = blockTypes; EntityTypes = entityTypes; ItemTypes = itemTypes; Deserializer = deserializer; }
public void SetTargetNearest(EntityTypes target) { float distance = float.MaxValue; for (int i = 0; i < this.LODMap.entities.Count; i++) //for (int i = 0; i < this.worldMap.entities.Count; i++) { if (this.LODMap.entities[i].Type == target) //if (this.worldMap.entities[i].Type == target) { float dist = this.DistanceTo(this.LODMap.entities[i]); //float dist = this.DistanceTo(this.worldMap.entities[i]); if (dist < distance) { distance = dist; //this.movement.TargetLocation = this.worldMap.entities[i].location; this.TargetLocation = this.LODMap.entities[i].location; } } else { } } this.TargetDistance = distance; }
public EntityStatsPacket(Guid id, EntityTypes type, Guid mapId, int[] stats) { Id = id; Type = type; MapId = mapId; Stats = stats; }
public ChatBubblePacket(Guid entityId, EntityTypes type, Guid mapId, string text) { EntityId = entityId; Type = type; MapId = mapId; Text = text; }
public Entity(Guid id, EntityTypes type, PointF location) { Id = id; EntityType = type; Location = location; Size = new SizeF(32, 64); DrawOffset = new PointF(0, -48); }
public EntityDE(EntityTypes type) { //EntityCode = string.Empty; EntityName = string.Empty; EntityTypeCode = type.ToString(); Addresses = new List<AddressDE>(); Contacts = new List<ContactDE>(); Code = string.Empty; }
protected new void Page_Init(object sender, EventArgs e) { SessionObject = (SessionObject)Session["SessionObject"]; _level = SessionObject.LCOrole; _userId = SessionObject.LoggedInUser.Page; GetLcOforCourse(); LoadCourseObjectFolders(); LoadCourseObjectTiles(); InitPage(ctlFolders, ctlDoublePanel, sender, e); LoadDefaultFolderTiles(); if (SessionObject.SelectedUser == null) return; }
protected new void Page_Init(object sender, EventArgs e) { SessionObject = (SessionObject)Session["SessionObject"]; base.Page_Init(sender, e); if (Tile == null) return; _level = SessionObject.LCOrole; _lcos = (List<Thinkgate.Base.Classes.LCO>)Tile.TileParms.GetParm("lcos"); _userID = SessionObject.LoggedInUser.Page; SetControlVisibility(); AttatchLevelToKeys(); }
protected new void Page_Init(object sender, EventArgs e) { SessionObject = (SessionObject)Session["SessionObject"]; base.Page_Init(sender, e); _userID = SessionObject.LoggedInUser.Page; if (Tile == null) return; _lco = ((Thinkgate.Base.Classes.LCO)Tile.TileParms.GetParm("LCO")); _level = SessionObject.LCOrole; SetControlVisibility(); if (!IsPostBack) { BuildLists(); } }
void SetEntityType(EntityTypes type) { switch(type) { case EntityTypes.None: Entity = null; break; case EntityTypes.Player: Entity = new PlayerEntity(); break; } lastEntityType = type; if (Entity != null) Entity.SetEntityDefaults(); }
protected new void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); _category = (String)Tile.TileParms.GetParm("category"); _level = (EntityTypes)Tile.TileParms.GetParm("level"); _levelID = (Int32)Tile.TileParms.GetParm("levelID"); //PLH - 01/15/2013 - Fix for forcing Classroom assessments to drill down to selected school in Classes folder only. if (Tile.TileParms.Parms.ContainsKey("schoolID")) { _schoolID = (int)Tile.TileParms.GetParm("schoolID"); } if (Tile.TileParms.GetParm("showCalendarIcon") != null) { _calendarIconVisible = DataIntegrity.ConvertToBool(Tile.TileParms.GetParm("showCalendarIcon")); } dictionaryItem = Base.Classes.TestTypes.TypeWithSecureFlag(_category); isSecuredFlag = dictionaryItem != null && dictionaryItem.Where(x => Boolean.Parse(x.Value.ToString())).Select(y => y.Key).ToList().Distinct().Any(); }
public static DetailsViewModel Invoke(EntityTypes entityType, string id) { IMedia result = null; if (entityType == EntityTypes.Movies) result = _movieManagementService.GetById(id); if(entityType == EntityTypes.Songs) result = _songManagementService.GetById(id); if (entityType == EntityTypes.Books) result = _bookManagementService.GetById(id); return new DetailsViewModel { FullSizeImagePath = result.FullSizeImagePath, Name = result.Name, ReleaseDate = result.ReleaseDate, StreamingUrl = result.StreamingUrl, CoverArtistDisplayName = result.CoverArtistDisplayName, Genre = result.Genre }; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { /* grab the session object to evaluate */ _sessionObject = (SessionObject)Session["SessionObject"]; /* obtain the userId */ _userId = _sessionObject.LoggedInUser.Page; /* Didn't inherit from TileControlBase, I can't use the TileParms for level * Have to use RolePortal for _level. MA has 1 district ID (22936). * I have to get it from the logged in user */ var rolePortal = (RolePortal)_sessionObject.LoggedInUser.Roles.Where(w => w.RolePortalSelection != 0).Min(m => m.RolePortalSelection); /* Check rolePortal, set level and levelId */ switch (rolePortal) { case RolePortal.School: case RolePortal.District: if (Request.QueryString["levelID"] != null && !String.IsNullOrEmpty(Request.QueryString["levelID"])) { _levelID = Cryptography.GetDecryptedID(_sessionObject.LoggedInUser.CipherKey); } else { _levelID = _sessionObject.LoggedInUser.District; _level = rolePortal == RolePortal.District ? EntityTypes.District : EntityTypes.School; } SetUpNonTeacherUi(); // Setup UI LoadPieCharts(); // Load charts break; case RolePortal.Teacher: { _level = EntityTypes.Teacher; // Set _level SetUpTeacherUi(); // Setup UI break; } } } }
/// <summary> /// Sets enemy career and prepares entity settings. /// </summary> public void SetEnemyCareer(MobileEnemy mobileEnemy, EntityTypes entityType) { if (entityType == EntityTypes.EnemyMonster) { careerIndex = (int)mobileEnemy.ID; career = GetMonsterCareerTemplate((MonsterCareers)careerIndex); stats.SetFromCareer(career); // Enemy monster has predefined level and health level = career.HitPointsPerLevelOrMonsterLevel; maxHealth = UnityEngine.Random.Range(mobileEnemy.MinHealth, mobileEnemy.MaxHealth + 1); } else if (entityType == EntityTypes.EnemyClass) { careerIndex = (int)mobileEnemy.ID - 128; career = GetClassCareerTemplate((ClassCareers)careerIndex); stats.SetFromCareer(career); // Enemy class is levelled to player and uses same health rules level = GameManager.Instance.PlayerEntity.Level; maxHealth = FormulaHelper.RollMaxHealth(level, stats.Endurance, career.HitPointsPerLevelOrMonsterLevel); // Enemy class damage is temporarily set by a fudged level multiplier // This will change once full entity setup and items are available const float damageMultiplier = 4f; mobileEnemy.MinDamage = (int)(level * damageMultiplier); mobileEnemy.MaxDamage = (int)((level + 2) * damageMultiplier); } else { career = new DFCareer(); careerIndex = -1; return; } this.mobileEnemy = mobileEnemy; this.entityType = entityType; name = career.Name; FillVitalSigns(); }
public StaticEntity CreatePassive16x16Entities(EntityTypes.Passive16x16 type) { switch (type) { case EntityTypes.Passive16x16.DOT: return new StaticEntity(new Point(0, 0), new Vector2(0, 0), 0.5f, 0.001f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.APPLE_RED: return new StaticEntity(new Point(1, 0), new Vector2(0, 0), 0.5f, 0.002f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.BULB: return new StaticEntity(new Point(2, 0), new Vector2(0, 0), 0.5f, 0.002f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.BANANA: return new StaticEntity(new Point(3, 0), new Vector2(0, 0), 0.5f, 0.003f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.APPLE_GREEN: return new StaticEntity(new Point(4, 0), new Vector2(0, 0), 0.5f, 0.002f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.ORANGE: return new StaticEntity(new Point(5, 0), new Vector2(0, 0), 0.5f, 0.004f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.ARTICHOKE: return new StaticEntity(new Point(6, 0), new Vector2(0, 0), 0.5f, 0.003f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.BERRIES: return new StaticEntity(new Point(7, 0), new Vector2(0, 0), 0.5f, 0.005f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.LEMON: return new StaticEntity(new Point(8, 0), new Vector2(0, 0), 0.5f, 0.003f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.ICE: return new StaticEntity(new Point(9, 0), new Vector2(0, 0), 0.5f, 0.005f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.TREE_SMALL: return new StaticEntity(new Point(10, 0), new Vector2(0, 0), 2.0f, 0.020f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.DUDE: return new StaticEntity(new Point(11, 0), new Vector2(0, 0), 1.9f, 0.018f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.MARIO: return new StaticEntity(new Point(12, 0), new Vector2(0, 0), 1.1f, 0.015f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.LUIGI: return new StaticEntity(new Point(13, 0), new Vector2(0, 0), 1.1f, 0.015f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.HAT: return new StaticEntity(new Point(14, 0), new Vector2(0, 0), 1.5f, 0.012f, Globals.SHEETS["16x16"]); case EntityTypes.Passive16x16.POWERUP: return new StaticEntity(new Point(15, 0), new Vector2(0, 0), 2.0f, 0.017f, Globals.SHEETS["16x16"]); } return null; }
protected new void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); /********************************************************************************************** * Only update for this control firing (Telerik Ajax postback for all user controls) * * Looks for postback control id's containing "MTSS Interventions" (quick solution) * **********************************************************************************************/ if (IsPostBack) { String postBackControlID = GetControlThatCausedPostBack(Parent.Page); if (!String.IsNullOrEmpty(postBackControlID) && !postBackControlID.StartsWith("folder") && !postBackControlID.StartsWith("tileContainer") && !postBackControlID.Contains("MTSSInterventions")) { return; //Return to avoid pulling data again when other user controls refresh via ajax } } if (Tile == null || Tile.TileParms == null) return; //COMMENT: RE this was breaking code, not sure what/if is required put a condition to protect from breaking if (Tile.TileParms.GetParm("type") != null) Tile.TileParms.GetParm("type").ToString(); if (Tile.TileParms.GetParm("level") != null) _level = (EntityTypes)Tile.TileParms.GetParm("level"); if (Tile.TileParms.GetParm("levelID") != null) _levelID = (Int32)Tile.TileParms.GetParm("levelID"); _isFormColumnEnabled = (bool)Tile.TileParms.GetParm("isFormColumnEnabled"); btnAdd.Attributes["title"] = string.Format("Add New {0}", Tile.Title); _CurrCourseList = CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); }
private static bool IsAddableType(EntityTypes type) { if (type == EntityTypes.Health) return true; if (type == EntityTypes.Shotgun) return true; if (type == EntityTypes.Blaster) return true; if (type == EntityTypes.Railgun) return true; if (type == EntityTypes.RocketLauncher) return true; if (type == EntityTypes.Flag) return true; return false; }
public void SetEntityType(string table, EntityTypes type) { entityTypes[table] = type; }
public void initialize(int ID, EntityTypes entityType, bool combatFlag, char symbol, string name, Stats stats, Position currentPosition, Position previousPosition, ConsoleColor color, bool alive, bool show) { this.ID = ID; this.entityType = entityType; this.combatFlag = combatFlag; this.name = name; this.stats = stats; this.symbol = symbol; this.currentPosition = currentPosition; this.previousPosition = previousPosition; this.color = color; this.alive = alive; this.show = true; this.inventory = new Inventory(); }
private void AddRecipes( TreeNode entityNode, long entityId, EntityTypes entityType ) { IEnumerable<Recipe> recipes = Db.SelectRecipesByResultIdandType( entityId, entityType ); if ( !recipes.Any() ) return; if (entityType == EntityTypes.Recipe) { entityId = 0; } AddRecipeToNode( entityNode, recipes, recipes.First(), entityId ); }
public Entity(int ID, EntityTypes entityType, bool combatFlag, char symbol, string name, Stats stats, Position currentPosition, Position previousPosition, ConsoleColor color, bool alive, bool show) { initialize(ID, entityType, combatFlag, symbol, name, stats, currentPosition, previousPosition, color, alive, show); moved = true; }
void Update() { // Change entity type if (EntityType != lastEntityType) { SetEntityType(EntityType); lastEntityType = EntityType; } // Update entity Entity.Update(this); }
void Update() { if (EntityType != lastEntityType) { SetEntityType(EntityType); lastEntityType = EntityType; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["category"] == null) return; CheckLrmiDisplay(); if (!string.IsNullOrEmpty(hiddenSelectedCount.Text)) { lblSelectedCount.InnerText = "Records selected: " + hiddenSelectedCount.Text; radBtnLock.Enabled = radBtnUnlock.Enabled = radBtnActivate.Enabled = radBtnDeactivate.Enabled = radBtnViewTestEvents.Enabled = true; } _level = !string.IsNullOrEmpty(Request.QueryString["level"]) ? (EntityTypes)Enum.Parse(typeof(EntityTypes), Request.QueryString["level"]) : EntityTypes.Teacher; Category = Request.QueryString["category"]; if (!string.IsNullOrEmpty(hiddenGuidBox.Text)) { PageGuid = hiddenGuidBox.Text; } else { PageGuid = Guid.NewGuid().ToString().Replace("-", ""); hiddenGuidBox.Text = PageGuid; } switch (Category.ToLower()) { case "classroom": permAssessNameHyperLinksActive = UserHasPermission(Permission.Hyperlink_AssessmentNameClassroom); break; case "district": permAssessNameHyperLinksActive = UserHasPermission(Permission.Hyperlink_AssessmentNameDistrict); break; case "state": permAssessNameHyperLinksActive = UserHasPermission(Permission.Hyperlink_AssessmentNameState); break; } if (!IsPostBack) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "anything", BuildStartupScript(exportGridImgBtn.ClientID, "../..", PageGuid), false); // get role name from the session object Thinkgate.Classes.SessionObject sessionObject = (SessionObject)Session["SessionObject"]; _loggedOnUserRoleName = sessionObject.LoggedInUser.Roles[0].RoleName; _schoolId = sessionObject.LoggedInUser.School; } ControlIconVisibility(); ParseRequestQueryString(); LoadSearchCriteriaControl(); LoadLRMISearchControl(); if (radGridResults.DataSource == null && string.IsNullOrEmpty(hiddenSelectedCount.Text)) { radGridResults.Visible = false; initialDisplayText.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = "Press Search...." }); initialDisplayText.Visible = true; } if (IsPostBack) { radGridResults.Visible = true; RadScriptManager scriptManager = (RadScriptManager)ScriptManager.GetCurrent(this.Page); scriptManager.RegisterPostBackControl(this.exportGridImgBtn); } }
private void ParseRequestQueryString() { if (string.IsNullOrEmpty(Request.QueryString["level"])) { SessionObject.RedirectMessage = "No level provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } _level = (EntityTypes)EnumUtils.enumValueOf(Request.QueryString["level"], typeof(EntityTypes)); if (string.IsNullOrEmpty(Request.QueryString["levelID"])) { SessionObject.RedirectMessage = "No levelID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } _levelID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey, "levelID"); }