Example #1
0
        public void AddWatch(Entity entity, bool isVision)
        {
            if (entity == null)
            {
                return;
            }
            entity = entity.GetRoot();
            if (entity.Get <FactionComponent>().Faction == Faction)
            {
                return;
            }
            var watcher = GetWatchTarget(entity);

            if (watcher == null)
            {
                watcher = new WatchTarget(entity);
                WatchTargets.Add(watcher);
            }
            watcher.LastSensedTurnCount = 0;
            watcher.LastSensedPos       = entity.Get <GridPosition>();
            if (watcher.Seen && !isVision)
            {
                return;
            }
            watcher.Seen = isVision;
        }
Example #2
0
 public void RemoveWatch(WatchTarget watcher)
 {
     WatchTargets.Remove(watcher);
 }