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:
2016-12-12 23:28:41 +02:00
parent 6fe33a99a8
commit 6a35b11ec2
34 changed files with 885 additions and 573 deletions

View File

@@ -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
View 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_ */