Exemplo n.º 1
0
        public bool Untrack(IFlyEntity entity)
        {
            LifeTrackedEntity trackedEntity = this.entities.Find(te => te.FlyEntity == entity);

            if (this.entities.Remove(trackedEntity))
            {
                this.OnUntracked(trackedEntity);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public void Track(IFlyEntity entity)
        {
            var lifeBar = new LifeBar()
            {
                Entity = entity
            };

            var trackedEntity = new LifeTrackedEntity()
            {
                FlyEntity = entity, LifeBar = lifeBar
            };

            this.entities.Add(trackedEntity);
            this.OnTracked(trackedEntity);
        }
Exemplo n.º 3
0
 private void OnUntracked(LifeTrackedEntity entity)
 {
     this.userInterface.RemoveElement(entity.LifeBar);
     this.LayoutLifeBars();
 }