-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development 4 map #16
Open
MicheleMichetti
wants to merge
65
commits into
develop
Choose a base branch
from
development-4-Map
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
ff53af4
Created Map.h
MicheleMichetti 58e9e9f
Created Map.cpp
MicheleMichetti 6a0ad5f
Created test for Map
MicheleMichetti 8ce95b8
Added Map.h and Map.cpp
MicheleMichetti f238951
Added destructor and included Tile.h
MicheleMichetti 8d2e6f1
populated destructor, doesItCollide, doesItInteract
MicheleMichetti 09b2ef2
Imported prototype test map definition.
MicheleMichetti 10ca6b4
doc: Update README.md
MicheleMichetti 07ccf18
Update README.md
marc-gav 3f9de8a
doc: Update README.md
marc-gav 1e3bc7e
doc: Update README.md
marc-gav 8e97c0a
feat: Pull request template
marc-gav 71175ed
feat: Update PULL_REQUEST_TEMPLATE.md
marc-gav 9386af1
switched tiles_ from std::map to boost::multi_array.
MicheleMichetti 6a477ca
feat: Tile class basic structure
marc-gav 06f8d35
feat: Update gitignore
marc-gav 79b3916
feat: Tile class logic
marc-gav 783473f
feat: Include coordinate into Tile class
marc-gav 1023daa
refactor: Coordinate not needed for tile
marc-gav 9735180
fix: Direction enum utils.hpp
marc-gav 72fc2ec
feat: Skeleton of testing capabilities
marc-gav be446c3
feat: Testing skeleton
marc-gav f933a28
fix: Add execution permissions for build_docker_image.sh
marc-gav 1a3f584
feat: Update gitignore
marc-gav 11f5d0b
feat: Add google test library
marc-gav 3f9603f
feat: Add Json reader
marc-gav 58e2801
feat: CMakeLists.txt new hierarchy
marc-gav 230fc77
refactor: Re-organize code structure
marc-gav 6088184
feat: Dummy unit test
marc-gav ec0bdd9
feat: Interactive docker image scripts
marc-gav 2822060
feat: Automated tests using github actions
marc-gav 0e49c1c
doc: New simplified Docker instructions
marc-gav a7a3ace
breaking: Test failed testing pipeline behaviour
marc-gav cdb2030
fix: Fix breaking change
marc-gav 74310c5
fix: Update CMakeLists.txt
marc-gav b2de58e
doc: Update README.md
marc-gav 2659a5c
doc: Update README.md
marc-gav 76565c9
fix: Incorporate PR comments
marc-gav 6b2c26b
feat: Auto-formatter
marc-gav 686f113
feat: Update clang formatter with current code structure
marc-gav 884638a
fix: Clang formatter list of files
marc-gav 9755ed2
feat: Nice clang-format workflow
marc-gav 5306a8b
feat: Improve clang-format.yml
marc-gav 02d002d
Refactor .h -> .hpp and correct typos
MicheleMichetti f5ba44b
Correction in Map.cpp->swapTiles()
MicheleMichetti e89a375
Merge branch 'develop' into development-4-Map
MicheleMichetti 9a3ae73
Fixed includes
MicheleMichetti 0d0a406
Merge branch 'develop' into development-4-Map
marc-gav da9e23c
Autoformat code
marc-gav 970bc66
Moved hpp and cpp in the new structure. Updated dependencies.
MicheleMichetti 983abbd
Install boost lib in docker and include in CMakeLists. Not in a worki…
MicheleMichetti 2826648
Autoformat code
MicheleMichetti bb09edc
Use consistent variable format "my_variable"
MicheleMichetti 5aa42de
Using consistent member name format "my_member"
MicheleMichetti 23904ce
Autoformat code
MicheleMichetti 0aed526
fix: Find Boost library CMakeLists.txt
marc-gav fd45343
feat: install spdlog to Docker container and include it in CMake.
MicheleMichetti 3d0d8c2
feat: Added tile matrix of dimension 0 error. Made some variables for…
MicheleMichetti a06f53d
fix: changed the argument type of the functions Tile::isCollision and…
MicheleMichetti 140381e
fix: changed the argument type of the functions Map::doesItCollide an…
MicheleMichetti cb7268c
fix: fixed passage of coordinates to collision and interaction functions
MicheleMichetti 6e7fbfa
fix: swapTiles() in Map class coherence between cpp and hpp
MicheleMichetti 026a9d5
Added map type enum. Throw invalid_argument. Use std::swap
MicheleMichetti 38b83be
Autoformat code
MicheleMichetti f94d728
Merge branch 'develop' into development-4-Map
MicheleMichetti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,12 +1,14 @@ | ||||||||||
#include <Map.hpp> | ||||||||||
|
||||||||||
Map::Map(const uint16_t& id, const uint8_t& current_type, const std::string& map_name, const std::string& bitmap_name, const tileArray& tiles, const uint16_t& dimensionX, const uint16_t& dimensionY, | ||||||||||
#include "spdlog/spdlog.h" | ||||||||||
|
||||||||||
Map::Map(const uint16_t& id, const uint8_t& current_type, const std::string& map_name, const std::string& bitmap_name, const tileArray& tiles, const uint16_t& length_x, const uint16_t& length_y, | ||||||||||
const entityMap& entities) { | ||||||||||
setId(id); | ||||||||||
setCurrentType(current_type); | ||||||||||
setMapName(map_name); | ||||||||||
setBitmapName(bitmap_name); | ||||||||||
setTiles(tiles, dimensionX, dimensionY); | ||||||||||
setTiles(tiles, length_x, length_y); | ||||||||||
setEntities(entities); | ||||||||||
} | ||||||||||
|
||||||||||
|
@@ -16,11 +18,13 @@ void Map::setId(const uint16_t& id) { this->id_ = id; } | |||||||||
void Map::setcurrentType(const uint8_t& current_type) { this->current_type_ = current_type; } | ||||||||||
void Map::setMapName(const std::string& map_name) { this->map_name_ = map_name; } | ||||||||||
void Map::setBitmapName(const std::string& bitmap_name) { this->bitmap_name_ = bitmap_name; } | ||||||||||
void Map::setTiles(const tileArray& tiles, const uint16_t& dimensionX, const uint16_t& dimensionY) { | ||||||||||
if (dimensionX == 0 || dimensionY == 0) { | ||||||||||
void Map::setTiles(const tileArray& tiles, const uint16_t& length_x, const uint16_t& length_y) { | ||||||||||
if (length_x == 0 || length_y == 0) { | ||||||||||
SPDLOG_ERROR("The tile matrix that is being set has a dimension of value 0. Exiting. "); | ||||||||||
throw; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
return; | ||||||||||
} | ||||||||||
tiles_.resize(boost::extents[dimensionX][dimensionY]); | ||||||||||
tiles_.resize(boost::extents[length_x][length_y]); | ||||||||||
this->tiles_ = tiles; | ||||||||||
} | ||||||||||
void Map::setEntities(const entityMap& entities) { this->entities_ = entities; } | ||||||||||
|
@@ -33,10 +37,10 @@ const std::string Map::getBitmapName() { return bitmap_name_; } | |||||||||
const tileArray Map::getTiles() { return tiles_; } | ||||||||||
const entityMap Map::getEntities() { return entities_; } | ||||||||||
|
||||||||||
void Map::swapTiles(Tile& tile1, Tile& tile2) { | ||||||||||
Tile tiletmp = tile1; | ||||||||||
tile1 = tile2; | ||||||||||
tile2 = tiletmp; | ||||||||||
void Map::swapTiles(Tile& tile_1, Tile& tile_2) { | ||||||||||
Tile tiletmp = tile_1; | ||||||||||
tile_1 = tile_2; | ||||||||||
tile_2 = tiletmp; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
bool Map::doesItCollide(const utils::Coordinate& coordinate, const uint8_t& direction) { | ||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create an enum of possible map types