Exemple #1
0
        public void Remove(Entity mob)
        {
            MobEntities.TryRemove(mob.Id, out _);

            EntityCount--;
            AllEntityCount--;
        }
Exemple #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (m_ent != null)
         {
             m_ent.Dispose();
             m_ent = null;
         }
     }
 }
Exemple #3
0
        public void Add(Entity mob)
        {
            mob.SetId(_next_id);

            if (MobEntities.TryAdd(mob.Id, mob))
            {
                _next_id++;

                mob.SetGridCell(this);
                EntityCount++;
                AllEntityCount++;
            }
        }
Exemple #4
0
        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();
            }
        }
Exemple #5
0
        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++;
            }
        }
Exemple #6
0
        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);
        }
Exemple #7
0
 public SharedAPIArtistRepository()
 {
     m_context = new MobEntities();
 }