示例#1
0
 protected void Apply(ITexturable <RenderTexture> texturable)
 {
     texturable.Texture = ActiveTexture;
 }
示例#2
0
        public void TickEntities(GameTime gameTime)
        {
            lock (someLock)
            {
                List <AbsEntity> toUpdate = _entities.ToList();

                foreach (AbsEntity e in toUpdate)
                {
                    e.Tick((int)gameTime.ElapsedGameTime.TotalMilliseconds);
                    ITexturable Texturable = e as ITexturable;
                    if (Texturable != null)
                    {
                        Texturable.UpdateTexture((int)gameTime.ElapsedGameTime.TotalMilliseconds);
                    }
                }
                if (Joueur != null && Joueur.IsDead == false)
                {
                    Joueur.UpdateTexture((int)gameTime.ElapsedGameTime.TotalMilliseconds);  //Tick(DeltaTime);
                }
                if (Joueur != null && Joueur.IsDead == false)
                {
                    Joueur.Tick((long)gameTime.ElapsedGameTime.TotalMilliseconds);
                }

                /*if (_deadFire.Count != 0)
                 * {
                 *  FireFireStopped(this, new MultiFireEventArgs(_deadFire.ToArray(), false));
                 *  _deadFire = new List<Fire>();
                 * }*/
                List <absProjectile> projli = EntityManager.Instance.ProjectilesListFriendly;
                List <absProjectile> projho = EntityManager.Instance.ProjectilesListHostile;

                lock (someLock)
                {
                    for (int i = projli.Count - 1; i >= 0; i--)
                    {
                        try
                        {
                            if (projli[i].Update(gameTime))
                            {
                                projli.RemoveAt(i);
                            }
                        }
                        catch
                        {
                        }
                    }
                    for (int i = projho.Count - 1; i >= 0; i--)
                    {
                        try
                        {
                            if (projho[i].Update(gameTime))
                            {
                                projho.RemoveAt(i);
                            }
                        }
                        catch
                        {
                        }
                    }
                    for (int i = this.Bonus.Count - 1; i >= 0; i--)
                    {
                        this.Bonus[i].Tick((long)gameTime.ElapsedGameTime.TotalMilliseconds);
                    }
                }
            }
        }