public void Remove(Entity mob) { MobEntities.TryRemove(mob.Id, out _); EntityCount--; AllEntityCount--; }
protected virtual void Dispose(bool disposing) { if (disposing) { if (m_ent != null) { m_ent.Dispose(); m_ent = null; } } }
public void Add(Entity mob) { mob.SetId(_next_id); if (MobEntities.TryAdd(mob.Id, mob)) { _next_id++; mob.SetGridCell(this); EntityCount++; AllEntityCount++; } }
protected void Page_Load(object sender, EventArgs e) { using (MobEntities context = new MobEntities()) { //last 20 Artist records created var newArtistsQuery = (from m in context.Artists orderby m.CreateDate descending select m).Take(20); List <Artist> newArtistsList = newArtistsQuery.ToList <Artist>(); NewArtistDataList.DataSource = newArtistsList; NewArtistDataList.DataBind(); } }
public void ReAdd(Entity mob) { if (MobEntities.TryAdd(mob.Id, mob)) { GridCell cell = mob.GridCell; mob.SetGridCell(this); if (cell != null) { cell.Remove(mob); } EntityCount++; AllEntityCount++; } }
public bool GetEntity(ushort id, out EntityBase entity) { entity = null; if (ResourceEntites.ContainsKey(id)) { entity = ResourceEntites[id]; return(true); } if (MobEntities.ContainsKey(id)) { entity = MobEntities[id]; return(true); } if (PlayersById.ContainsKey(id)) { entity = PlayersById[id]; return(true); } return(false); }
public SharedAPIArtistRepository() { m_context = new MobEntities(); }