CellDatasight.from(source).isFree(target)
Usage:
{@code
final BattlefieldSightsight.from(source).isFree(target)
Usage:
{@code
final BattlefieldSightnew CoordinateCell<>(cell)
Note: this method will always recreate a new CoordinateCell instance
// Compute distance between two cells
int distance = current.coordinate().distance(target.coordinate());
You can optimise CoordinateCell creation by storing them into the cell instance,
optionally wrapped into a WeakReference :
{@code
class MyCell extends MapCell
String encoded = encoder.encode(myPath);
Path decoded = encoder.decode(encoded, startCell);
String encoded = encoder.encodeWithStartCell(myPath);
Path decoded = encoder.decode(encoded);
MapDataSerializer serializer = new EncryptedMapDataSerializer(Key.parse(gdm.key()));
CellData[] cells = serializer.deserialize(encryptedMapData);
https://github.com/Emudofus/Dofus/blob/1.29/dofus/managers/MapsServersManager.as#L137
final CellSight<FightCell> sight = fighter.cell().sight();
final CoordinateCell<FightCell> to = new CoordinateCell<>(target.cell());
sight.forEach((cell, free) -> {
if (free) {
performActionOnAccessibleCell(cell);
}
});
final BattlefieldSight<FightCell> sight = new BattlefieldSight<>(map);
final CoordinateCell<FightCell> current = new CoordinateCell<>(fighter.cell());
sight.from(current).to(target.cell()).forEachRemaining(cell -> {
// Iterator on line of sight
});
final BattlefieldSight<FightCell> sight = new BattlefieldSight<>(map);
sight.from(fighter.cell()).to(target.cell()).forEachRemaining(cell -> {
// Iterator on line of sight
});
// Note: the template parameter should be the used domain interface or class
interface MyMapCell extends MapCell<MapCell> {
public void myCustomOperation();
}
decoder
.pathfinder()
.targetDistance(2)
.directions(Direction.values())
.findPath(fighter.cell(), target)
;
new CellSight<>(cell)
Note: each call of this method will recreate a new CellSight instance
{@code
// Check if the "target" cell is accessible from the current cell
if (!MapCell.walkable()
CellData[] cells = serializer.withKey(gdm.key()).deserialize(mapData);
Copyright © 2022. All rights reserved.