示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entity"></param>
        public void ShowEntity(Entity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            this.entitySprite = new EntitySprite(surf);
            this.frontSprites.Add(this.entitySprite);
            SectorSprite sectSprite = this.GetSectorSprite(entity.Sector);

            this.entitySprite.Center = sectSprite.Center;
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sector"></param>
        /// <returns></returns>
        public SectorSprite GetSectorSprite(Sector sector)
        {
            SectorSprite sectSprite = null;

            foreach (SectorSprite s in this.backSprites)
            {
                if (s.Sector == sector)
                {
                    sectSprite = s;
                }
            }
            return(sectSprite);
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entity"></param>
        public void MoveEntity(Entity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            SectorSprite sectSprite = this.GetSectorSprite(entity.Sector);

            this.entitySprite.Center = sectSprite.Center;
            if (this.sound != null)
            {
                this.sound.Play();
            }
        }