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

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