/// <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; }
/// <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); }
/// <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(); } }