MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / groupMove

Method groupMove

game/state/tilemap/pathfinding.cpp:850–1130  ·  view source on GitHub ↗

FIXME: Implement usage of teleporters in group move

Source from the content-addressed store, hash-verified

848
849// FIXME: Implement usage of teleporters in group move
850void Battle::groupMove(GameState &state, std::list<StateRef<BattleUnit>> &selectedUnits,
851 Vec3<int> targetLocation, int facingDelta, bool demandGiveWay,
852 bool useTeleporter)
853{
854 std::ignore = useTeleporter;
855 // Legend:
856 //
857 // (arrive from the southwest) (arrive from the south)
858 //
859 // 6 G = goal 7 G = goal
860 // 5 6 F = flanks 7 7 1 = 1s back row
861 // 4 5 6 1 = 1st back row 6 6 6 2 = 2nd back row
862 // 3 F 5 6 2 = 2nd back row 5 5 5 5 3 = 3rd back row
863 // 2 1 G 5 6 3 = sides of 1st back row F F G F F 4 = sides of 1st bk row
864 // 2 1 F 5 4 = sides of flanks 4 1 1 4 F = flanks
865 // 2 1 4 5 = 1st front row 2 2 2 5 = 1st front row
866 // 2 3 6 = 2nd front row 3 3 6 = 2nd front row
867 // 2 3 7 = 3rd front row
868 //
869 // We will of course rotate this accordingly with the direction from which units come
870
871 static const std::list<Vec3<int>> targetOffsetsDiagonal = {
872 // Two locations to the flanks
873 {-1, -1, 0},
874 {1, 1, 0},
875 // Three locations in the 1st back row
876 {-1, 1, 0},
877 {-2, 0, 0},
878 {0, 2, 0},
879 // 2nd Back row
880 {-2, 2, 0},
881 {-3, 1, 0},
882 {-1, 3, 0},
883 {-4, 0, 0},
884 {0, 4, 0},
885 // Two locations to the side of the 1st back row
886 {-3, -1, 0},
887 {1, 3, 0},
888 // Two locations to the side of the flanks
889 {-2, -2, 0},
890 {2, 2, 0},
891 // 1st Front row
892 {1, -1, 0},
893 {0, -2, 0},
894 {2, 0, 0},
895 {-1, -3, 0},
896 {3, 1, 0},
897 // 2nd Front row
898 {2, -2, 0},
899 {1, -3, 0},
900 {3, -1, 0},
901 {0, -4, 0},
902 {4, 0, 0},
903 };
904 static const std::map<Vec2<int>, int> rotationDiagonal = {
905 {{1, -1}, 0},
906 {{1, 1}, 1},
907 {{-1, 1}, 2},

Callers 3

orderMoveMethod · 0.80
orderMoveMethod · 0.80

Calls 15

formatFunction · 0.85
clampFunction · 0.85
rotateFunction · 0.85
emptyMethod · 0.80
getActualSpeedValueMethod · 0.80
endMethod · 0.80
removeMethod · 0.80
getPlayerMethod · 0.80
getPreferredPositionMethod · 0.80
sizeMethod · 0.45
setMissionMethod · 0.45

Tested by

no test coverage detected