+ /// only valid if HasPlayer() returns true
+ Player &GetPlayer() noexcept { return *effective_player; }
+ const Player &GetPlayer() const noexcept { return *effective_player; }
+ /// change the effective player of this context
+ /// note that this will *not* change the effective entity
+ void SetPlayer(Player &p) noexcept { effective_player = &p; }
+
+ /// check if this context associates an entity
+ bool HasEntity() const noexcept { return effective_entity; }
+ /// get the entity on which operations should be performed
+ /// only valid if HasPlayer() returns true
+ Entity &GetEntity() noexcept { return *effective_entity; }
+ const Entity &GetEntity() const noexcept { return *effective_entity; }
+ /// change the effective player of this context
+ void SetEntity(Entity &e) noexcept { effective_entity = &e; }
+
+ /// reset effective player and entity to their original values
+ void Reset() noexcept {
+ effective_player = original_player;
+ effective_player = original_player;
+ }