Example #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);
 }
Example #2
0
        protected override void RemoveGeometry(ISceneGeometryObject Object)
        {
            bool Removed = _Geometry.Remove(Object);

            if (!Removed)
            {
                throw new KeyNotFoundException();
            }
        }
Example #3
0
 protected override IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint)
 {
     return(null);
 }
Example #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);
 }
Example #5
0
 /// <summary>
 /// Called when the specified geometry should be added to this Scene's geometry.
 /// </summary>
 protected abstract void AddGeometry(ISceneGeometryObject Object);
Example #6
0
 /// <summary>
 /// Override to perform handling the actual calculation of a global path.
 /// </summary>
 protected abstract IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint);
Example #7
0
 /// <summary>
 /// Called when the specified geometry should be removed from this Scene's geometry.
 /// </summary>
 protected abstract void RemoveGeometry(ISceneGeometryObject Object);
Example #8
0
 /// <summary>
 /// Called when the specified geometry should be added to this Scene's geometry.
 /// </summary>
 protected abstract void AddGeometry(ISceneGeometryObject Object);
Example #9
0
 /// <summary>
 /// Override to perform handling the actual calculation of a global path.
 /// </summary>
 protected abstract IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint);
Example #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));
 }
Example #11
0
 /// <summary>
 /// Called when the specified geometry should be removed from this Scene's geometry.
 /// </summary>
 protected abstract void RemoveGeometry(ISceneGeometryObject Object);
 public void AdvanceNode()
 {
     this._CurrentNode = Nodes.Dequeue();
 }
 public TiledPlatformerGlobalPath(Queue<TiledPlatformerGeometryObject> Nodes)
 {
     this.Nodes = Nodes;
     this._CurrentNode = Nodes.Count > 0 ? Nodes.Dequeue() : null;
 }
Example #14
0
 protected override void RemoveGeometry(ISceneGeometryObject Object)
 {
     bool Removed = _Geometry.Remove(Object);
     if(!Removed)
         throw new KeyNotFoundException();
 }
Example #15
0
 protected override IGlobalPath PerformPathCalculation(Entity Entity, ISceneGeometryObject EndPoint)
 {
     return null;
 }
Example #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);
 }