public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; toSubCell = fromSubCell = info.SharesCell ? SubCell.Center : SubCell.FullCell; if (init.Contains <SubCellInit>()) { this.fromSubCell = this.toSubCell = init.Get <SubCellInit, SubCell>(); } if (init.Contains <LocationInit>()) { this.__fromCell = this.__toCell = init.Get <LocationInit, CPos>(); SetVisualPosition(self, fromCell.CenterPosition + MobileInfo.SubCellOffsets[fromSubCell]); } this.Facing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : info.InitialFacing; if (init.Contains <AltitudeInit>()) { var z = init.Get <AltitudeInit, int>() * 1024 / Game.CellSize; SetVisualPosition(self, CenterPosition + new WVec(0, 0, z - CenterPosition.Z)); } }
public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; toSubCell = fromSubCell = info.SharesCell ? SubCell.Center : SubCell.FullCell; if (init.Contains <SubCellInit>()) { this.fromSubCell = this.toSubCell = init.Get <SubCellInit, SubCell>(); } if (init.Contains <LocationInit>()) { this.__fromCell = this.__toCell = init.Get <LocationInit, CPos>(); SetVisualPosition(self, init.world.Map.CenterOfCell(fromCell) + MobileInfo.SubCellOffsets[fromSubCell]); } this.Facing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : info.InitialFacing; // Sets the visual position to WPos accuracy // Use LocationInit if you want to insert the actor into the ActorMap! if (init.Contains <CenterPositionInit>()) { SetVisualPosition(self, init.Get <CenterPositionInit, WPos>()); } }
public PathSearch(World world, MobileInfo mobileInfo, Player owner) { this.world = world; cellInfo = InitCellInfo(); this.mobileInfo = mobileInfo; this.owner = owner; queue = new PriorityQueue <PathDistance>(); }
public static PathSearch Search(World world, MobileInfo mi, Actor self, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { CheckForBlocked = checkForBlocked }; return(search); }
public static PathSearch Search(World world, MobileInfo mi, Actor self, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { CheckForBlocked = checkForBlocked }; return search; }
public PathSearch(World world, MobileInfo mobileInfo, Actor self) { this.world = world; cellInfo = InitCellInfo(); this.mobileInfo = mobileInfo; this.self = self; customCost = null; queue = new PriorityQueue <PathDistance>(); }
public static PathSearch Search(World world, MobileInfo mi, Player owner, bool checkForBlocked) { var search = new PathSearch(world, mi, owner) { checkForBlocked = checkForBlocked }; return(search); }
public static PathSearch FromPoint(World world, MobileInfo mi, Actor self, CPos from, CPos target, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { Heuristic = DefaultEstimator(target), CheckForBlocked = checkForBlocked }; search.AddInitialCell(from); return search; }
public static PathSearch FromPoint(World world, MobileInfo mi, Actor self, CPos from, CPos target, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { Heuristic = DefaultEstimator(target), CheckForBlocked = checkForBlocked }; search.AddInitialCell(from); return(search); }
public static PathSearch FromPoint(World world, MobileInfo mi, Player owner, int2 from, int2 target, bool checkForBlocked) { var search = new PathSearch(world, mi, owner) { heuristic = DefaultEstimator(target), checkForBlocked = checkForBlocked }; search.AddInitialCell(from); return(search); }
public PathSearch(World world, MobileInfo mobileInfo, Actor self) { this.self = self; CellInfo = InitCellInfo(); this.mobileInfo = mobileInfo; this.self = self; customCost = null; Queue = new PriorityQueue <PathDistance>(); Considered = new HashSet <CPos>(); MaxCost = 0; nextDirections = CVec.directions.Select(d => new Pair <CVec, int>(d, 0)).ToArray(); }
public PathSearch(World world, MobileInfo mobileInfo, Actor self) { this.self = self; CellInfo = InitCellInfo(); this.mobileInfo = mobileInfo; this.self = self; customCost = null; Queue = new PriorityQueue<PathDistance>(); Considered = new HashSet<CPos>(); MaxCost = 0; nextDirections = CVec.directions.Select(d => new Pair<CVec, int>(d, 0)).ToArray(); }
public static PathSearch FromPoints(World world, MobileInfo mi, Actor self, IEnumerable<CPos> froms, CPos target, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { Heuristic = DefaultEstimator(target), CheckForBlocked = checkForBlocked }; foreach (var sl in froms) search.AddInitialCell(sl); return search; }
public static PathSearch FromPoints(World world, MobileInfo mi, Player owner, IEnumerable <int2> froms, int2 target, bool checkForBlocked) { var search = new PathSearch(world, mi, owner) { heuristic = DefaultEstimator(target), checkForBlocked = checkForBlocked }; foreach (var sl in froms) { search.AddInitialCell(sl); } return(search); }
public static PathSearch FromPoints(World world, MobileInfo mi, Actor self, IEnumerable <CPos> froms, CPos target, bool checkForBlocked) { var search = new PathSearch(world, mi, self) { Heuristic = DefaultEstimator(target), CheckForBlocked = checkForBlocked }; foreach (var sl in froms) { search.AddInitialCell(sl); } return(search); }
public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; toSubCell = fromSubCell = info.SharesCell ? SubCell.Center : SubCell.FullCell; if (init.Contains <SubCellInit>()) { this.fromSubCell = this.toSubCell = init.Get <SubCellInit, SubCell>(); } if (init.Contains <LocationInit>()) { this.__fromCell = this.__toCell = init.Get <LocationInit, CPos>(); this.PxPosition = Util.CenterOfCell(fromCell) + info.SubCellOffsets[fromSubCell]; } this.Facing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : info.InitialFacing; this.Altitude = init.Contains <AltitudeInit>() ? init.Get <AltitudeInit, int>() : 0; }
public MoveOrderTargeter(Actor self, MobileInfo unitType) { this.unitType = unitType; this.rejectMove = !self.AcceptsOrder("Move"); }
public MoveOrderTargeter(MobileInfo unitType) { this.unitType = unitType; }