Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Merge requests
!23
Unit movement
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Unit movement
unit_movement
into
main
Overview
0
Commits
11
Pipelines
0
Changes
1
Merged
Unit movement
Lorenz Martin Diel
requested to merge
unit_movement
into
main
5 months ago
Overview
0
Commits
11
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
0291139d
Prev
Next
Show latest version
1 file
+
34
−
33
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
0291139d
Fix Inverse cliff corners having wrong move cost
· 0291139d
Frederik
authored
5 months ago
src/game/Level.hpp
+
34
−
33
View file @ 0291139d
Edit in single-file editor
Open in Web IDE
Show full file
@@ -22,39 +22,40 @@ namespace advanced_wars
const
int
NUM_TILE_IDS
=
30
;
// Aktualisieren, falls weitere IDs hinzugefügt werden
const
int
NUM_MOVEMENT_TYPES
=
6
;
const
std
::
array
<
std
::
array
<
int
,
NUM_MOVEMENT_TYPES
>
,
NUM_TILE_IDS
>
moveCostTable
=
{{
// FOOT, WHEELED, TREAD, AIR, SEA, LANDER
{
1
,
2
,
1
,
1
,
999
,
999
},
// PLAIN
{
999
,
999
,
999
,
1
,
1
,
1
},
// WATER
{
1
,
3
,
2
,
1
,
999
,
999
},
// FOREST
{
2
,
999
,
999
,
1
,
999
,
999
},
// MOUNTAIN
{
1
,
1
,
1
,
1
,
999
,
999
},
// BRIDGE_HORIZONTAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_HORIZONTAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_VERTICAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CROSSING
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_RIGHT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_DOWN
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_UP
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_TOP_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_TOP_RIGHT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_BOTTOM_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_BOTTOM_RIGHT
{
999
,
999
,
999
,
1
,
2
,
2
},
// RIFF
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_TOP
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_BOTTOM
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_TOP_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_TOP_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_BOTTOM_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_BOTTOM_RIGHT
{
1
,
2
,
1
,
1
,
999
,
999
},
// CLIFF_INVERSE_CORNER_TOP_LEFT
{
1
,
2
,
1
,
1
,
999
,
999
},
// CLIFF_INVERSE_CORNER_TOP_RIGHT
{
1
,
2
,
1
,
1
,
999
,
999
},
// CLIFF_INVERSE_CORNER_BOTTOM_LEFT
{
1
,
2
,
1
,
1
,
999
,
999
},
// CLIFF_INVERSE_CORNER_BOTTOM_RIGHT
}};
const
std
::
array
<
std
::
array
<
int
,
NUM_MOVEMENT_TYPES
>
,
NUM_TILE_IDS
>
moveCostTable
=
{
{
// FOOT, WHEELED, TREAD, AIR, SEA, LANDER
{
1
,
2
,
1
,
1
,
999
,
999
},
// PLAIN
{
999
,
999
,
999
,
1
,
1
,
1
},
// WATER
{
1
,
3
,
2
,
1
,
999
,
999
},
// FOREST
{
2
,
999
,
999
,
1
,
999
,
999
},
// MOUNTAIN
{
1
,
1
,
1
,
1
,
999
,
999
},
// BRIDGE_HORIZONTAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_HORIZONTAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_VERTICAL
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CROSSING
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_RIGHT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_DOWN
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_JUNCTION_UP
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_TOP_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_TOP_RIGHT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_BOTTOM_LEFT
{
1
,
1
,
1
,
1
,
999
,
999
},
// STREET_CORNER_BOTTOM_RIGHT
{
999
,
999
,
999
,
1
,
2
,
2
},
// RIFF
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_TOP
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_BOTTOM
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_TOP_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_TOP_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_BOTTOM_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_CORNER_BOTTOM_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_INVERSE_CORNER_TOP_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_INVERSE_CORNER_TOP_RIGHT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_INVERSE_CORNER_BOTTOM_LEFT
{
999
,
999
,
999
,
1
,
1
,
1
},
// CLIFF_INVERSE_CORNER_BOTTOM_RIGHT
}
};
enum
class
LevelState
{
Loading