-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add collision ref for collision handling
- Add actor id for clear identity check - Implement add and remove actor interface
- Loading branch information
1 parent
c260aa0
commit 372022d
Showing
13 changed files
with
180 additions
and
4 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef COLLISION_REF_HPP_INCLUDED | ||
#define COLLISION_REF_HPP_INCLUDED | ||
|
||
#include <string> | ||
|
||
class Collision; | ||
|
||
namespace salmon { | ||
class CollisionRef { | ||
public: | ||
CollisionRef(Collision& impl); | ||
|
||
// Checks against tile types | ||
bool tile() const; | ||
bool actor() const; | ||
bool mouse() const; | ||
bool none() const; | ||
|
||
std::string my_hitbox() const; | ||
std::string other_hitbox() const; | ||
|
||
unsigned get_actor_id() const; | ||
std::string get_tile_type() const; | ||
|
||
private: | ||
Collision* m_impl; | ||
}; | ||
} | ||
|
||
#endif // COLLISION_REF_HPP_INCLUDED |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "collision_ref.hpp" | ||
|
||
#include "actor/collision.hpp" | ||
|
||
using salmon::CollisionRef; | ||
|
||
CollisionRef::CollisionRef(Collision& impl) : m_impl(&impl) {} | ||
|
||
bool CollisionRef::tile() const {return m_impl->tile();} | ||
bool CollisionRef::actor() const {return m_impl->actor();} | ||
bool CollisionRef::mouse() const {return m_impl->mouse();} | ||
bool CollisionRef::none() const {return m_impl->none();} | ||
|
||
std::string CollisionRef::my_hitbox() const {return m_impl->my_hitbox();} | ||
std::string CollisionRef::other_hitbox() const {return m_impl->other_hitbox();} | ||
std::string CollisionRef::get_tile_type() const {return m_impl->get_type();} | ||
unsigned CollisionRef::get_actor_id() const {return m_impl->get_actor_id();} |
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
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