Documentation ¶
Index ¶
- func FindPath(gameMap *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, ...) (error, []*coordinate.Coordinate)
- func FindRegionPath(mp *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, ...) (error, []*_map.Region)
- func GetH(a, b *coordinate.Coordinate) int
- func GetNeighboursRegion(currRegion *RegionParent, openRegions, closeRegion *map[string]*RegionParent, ...)
- func LeftHandAlgorithm(moveUnit *unit.Unit, startX, startY, ToX, ToY float64, uuid string, ...) ([]*coordinate.Coordinate, error)
- func MinF(open, close *Points, xSize, ySize int) (min *coordinate.Coordinate, find bool)
- func MoveUnit(moveUnit *unit.Unit, ToX, ToY float64, mp *_map.Map, size int, uuid string, ...) ([]*coordinate.Coordinate, error)
- func PrepareInData(mp *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, ...) (*coordinate.Coordinate, *coordinate.Coordinate, int, int, error)
- func SearchEndPoint(startX, startY, ToX, ToY float64, moveUnit *unit.Unit, mp *_map.Map, ...) (float64, float64, bool)
- func SearchPoint(points *[]*coordinate.Coordinate, unitX, unitY int, mp *_map.Map, ...) (int, int, bool)
- type Points
- type RegionParent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPath ¶
func FindPath(gameMap *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, scaleMap int, units map[int]*unit.ShortUnitInfo, uuid string, regions []*_map.Region, unitsID []int) (error, []*coordinate.Coordinate)
func FindRegionPath ¶
func FindRegionPath(mp *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, uuid string) (error, []*_map.Region)
func GetH ¶
func GetH(a, b *coordinate.Coordinate) int
func GetNeighboursRegion ¶
func GetNeighboursRegion(currRegion *RegionParent, openRegions, closeRegion *map[string]*RegionParent, mp *_map.Map, wave int)
func LeftHandAlgorithm ¶
func LeftHandAlgorithm(moveUnit *unit.Unit, startX, startY, ToX, ToY float64, uuid string, units map[int]*unit.ShortUnitInfo, unitsID []int) ([]*coordinate.Coordinate, error)
func MinF ¶
func MinF(open, close *Points, xSize, ySize int) (min *coordinate.Coordinate, find bool)
func MoveUnit ¶
func MoveUnit(moveUnit *unit.Unit, ToX, ToY float64, mp *_map.Map, size int, uuid string, units map[int]*unit.ShortUnitInfo, unitsID []int) ([]*coordinate.Coordinate, error)
func PrepareInData ¶
func PrepareInData(mp *_map.Map, start, end *coordinate.Coordinate, gameUnit *unit.Unit, scaleMap int, regions []*_map.Region, units map[int]*unit.ShortUnitInfo, unitsID []int) (*coordinate.Coordinate, *coordinate.Coordinate, int, int, error)
func SearchEndPoint ¶
func SearchEndPoint(startX, startY, ToX, ToY float64, moveUnit *unit.Unit, mp *_map.Map, units map[int]*unit.ShortUnitInfo) (float64, float64, bool)
метод пускает от точки ToX, ToY 8 лузей по разным направлениям, что бы найти первое ближайшее место куда может встать юнит
func SearchPoint ¶
func SearchPoint(points *[]*coordinate.Coordinate, unitX, unitY int, mp *_map.Map, gameUnit *unit.Unit, size float64, units map[int]*unit.ShortUnitInfo, unitsID []int) (int, int, bool)
Types ¶
type RegionParent ¶
type RegionParent struct { Region *_map.Region Parent *RegionParent Wave int }
func GetFistRegion ¶
func GetFistRegion(openRegions, closeRegion *map[string]*RegionParent, maxWave int) *RegionParent
Click to show internal directories.
Click to hide internal directories.