Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.godlinggame.mapmodel;
- abstract public class OptimalPath
- {
- protected Map map = null;
- public OptimalPath( Map map )
- {
- setMap( map );
- }
- public void setMap( Map map )
- {
- this.map = map;
- }
- public double stepCost( MapLocation ml ) { return stepCost( ml, 0 ); }
- public double stepCost( int x, int y, double barrierWeight )
- {
- return stepCost( MapLocation.getLocation( x, y ), barrierWeight );
- }
- abstract public double stepCost( MapLocation ml, double barrierWeight );
- abstract public void clearPath();
- abstract public void addGoalPosition( MapLocation add );
- public void addGoalPositions( MapLocation add, int xwidth, int ywidth )
- {
- for (int i=0; i<xwidth; i++)
- for (int j=0; j<ywidth; j++)
- addGoalPosition( add.move( i, j ) );
- }
- abstract public void recomputePath();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement