Ejemplo n.º 1
0
 protected override void AddGeometry(ISceneGeometryObject Object)
 {
     Debug.Assert(Object is TiledPlatformerGeometryObject);
     // Of course we should use something like a QuadTree,
     // but we're not actually doing solid entities so too few to matter.
     _Geometry.Add(Object);
 }
Ejemplo n.º 2
0
        protected override void RemoveGeometry(ISceneGeometryObject Object)
        {
            bool Removed = _Geometry.Remove(Object);

            if (!Removed)
            {
                throw new KeyNotFoundException();
            }
        }
Ejemplo n.º 3
0
 protected override IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint)
 {
     return(null);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Calculates a global path to take the given entity to the specified EndPoint.
 /// </summary>
 public virtual IGlobalPath CalculateGlobalPath(Entity Entity, ISceneGeometryObject EndPoint)
 {
     // We can do some stuff like caching here if we want.
     return CalculateGlobalPath(Entity, EndPoint);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Called when the specified geometry should be added to this Scene's geometry.
 /// </summary>
 protected abstract void AddGeometry(ISceneGeometryObject Object);
Ejemplo n.º 6
0
 /// <summary>
 /// Override to perform handling the actual calculation of a global path.
 /// </summary>
 protected abstract IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint);
Ejemplo n.º 7
0
 /// <summary>
 /// Called when the specified geometry should be removed from this Scene's geometry.
 /// </summary>
 protected abstract void RemoveGeometry(ISceneGeometryObject Object);
Ejemplo n.º 8
0
 /// <summary>
 /// Called when the specified geometry should be added to this Scene's geometry.
 /// </summary>
 protected abstract void AddGeometry(ISceneGeometryObject Object);
Ejemplo n.º 9
0
 /// <summary>
 /// Override to perform handling the actual calculation of a global path.
 /// </summary>
 protected abstract IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint);
Ejemplo n.º 10
0
 /// <summary>
 /// Calculates a global path to take the given entity to the specified EndPoint.
 /// </summary>
 public virtual IGlobalPath CalculateGlobalPath(Entity Entity, ISceneGeometryObject EndPoint)
 {
     // We can do some stuff like caching here if we want.
     return(CalculateGlobalPath(Entity, EndPoint));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Called when the specified geometry should be removed from this Scene's geometry.
 /// </summary>
 protected abstract void RemoveGeometry(ISceneGeometryObject Object);
Ejemplo n.º 12
0
 public void AdvanceNode()
 {
     this._CurrentNode = Nodes.Dequeue();
 }
Ejemplo n.º 13
0
 public TiledPlatformerGlobalPath(Queue<TiledPlatformerGeometryObject> Nodes)
 {
     this.Nodes = Nodes;
     this._CurrentNode = Nodes.Count > 0 ? Nodes.Dequeue() : null;
 }
Ejemplo n.º 14
0
 protected override void RemoveGeometry(ISceneGeometryObject Object)
 {
     bool Removed = _Geometry.Remove(Object);
     if(!Removed)
         throw new KeyNotFoundException();
 }
Ejemplo n.º 15
0
 protected override IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint)
 {
     return null;
 }
Ejemplo n.º 16
0
 protected override void AddGeometry(ISceneGeometryObject Object)
 {
     Debug.Assert(Object is TiledPlatformerGeometryObject);
     // Of course we should use something like a QuadTree,
     // but we're not actually doing solid entities so too few to matter.
     _Geometry.Add(Object);
 }