コード例 #1
0
        public void Remove(Entity entity, Path path)
        {
            bool success = _Entities.Remove(entity);

            if (success && EntityLeft != null)
                EntityLeft(this, new EntityMovedEventArgs(entity, path));
        }
コード例 #2
0
        public void Add(Entity entity, Path path)
        {
            _Entities.Add(entity);

            if (EntityEntered != null)
                EntityEntered(this, new EntityMovedEventArgs(entity, path));
        }
コード例 #3
0
 public EntityMovedEventArgs(Entity entity, Path path)
 {
     Entity = entity;
     Path = path;
 }
コード例 #4
0
        public void MoveEntity(Entity entity, Path path)
        {
            if (path.From != null)
                path.From.Remove(entity, path);

            path.To.Add(entity, path);
        }
コード例 #5
0
        public bool UsePath(Path path)
        {
            World.Map.MoveEntity(this, path);

            if (Moved != null)
                Moved(this, new EntityMovedEventArgs(this, path));

            return true;
        }