Player changes:
- reimplemented & improved player inventory - now player has "Action2" which means he can interact with the environment - added weapon energy cost - updated player action interface
This commit is contained in:
@@ -158,7 +158,7 @@ namespace model {
|
||||
auto it = m_components.find(typeIndex);
|
||||
if (it != m_components.end())
|
||||
{
|
||||
comp = it->second;
|
||||
comp = dynamic_cast<T*>(it->second);
|
||||
m_components.erase(it);
|
||||
}
|
||||
|
||||
|
26
src/model/IPlayerAction.h
Normal file
26
src/model/IPlayerAction.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* ITool.h
|
||||
*
|
||||
* Created on: Dec 3, 2016
|
||||
* Author: tibi
|
||||
*/
|
||||
|
||||
#ifndef COMPONENTS_ITEMS_IPLAYERACTION_H_
|
||||
#define COMPONENTS_ITEMS_IPLAYERACTION_H_
|
||||
|
||||
#include <model/Direction.h>
|
||||
|
||||
namespace farmlands {
|
||||
namespace model {
|
||||
|
||||
class IPlayerAction
|
||||
{
|
||||
public:
|
||||
virtual ~IPlayerAction() { }
|
||||
virtual void performAction(float lookX, float lookY, float* timeCost, float* hpCost, float* energyCost) = 0;
|
||||
};
|
||||
|
||||
} /* namespace model */
|
||||
} /* namespace farmlands */
|
||||
|
||||
#endif /* COMPONENTS_ITEMS_IPLAYERACTION_H_ */
|
Reference in New Issue
Block a user