diff --git a/assets/items/Tools.items b/assets/items/Tools.items
index bed8e7a..3e6a0f3 100644
--- a/assets/items/Tools.items
+++ b/assets/items/Tools.items
@@ -15,6 +15,20 @@
+
+
+
+
+
+
+
+
+
diff --git a/assets/sprites/Player.sprite b/assets/sprites/Player.sprite
index 6b17c8a..0d0ee29 100644
--- a/assets/sprites/Player.sprite
+++ b/assets/sprites/Player.sprite
@@ -1,6 +1,6 @@
+ anchorX="0.5" anchorY="0.95">
diff --git a/assets/sprites/items/RustyWateringCan.sprite b/assets/sprites/items/RustyWateringCan.sprite
new file mode 100644
index 0000000..4a576cd
--- /dev/null
+++ b/assets/sprites/items/RustyWateringCan.sprite
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/sprites/items/wateringCan.png b/assets/sprites/items/wateringCan.png
new file mode 100644
index 0000000..e9ab965
Binary files /dev/null and b/assets/sprites/items/wateringCan.png differ
diff --git a/assets/tilesets/Ground.png b/assets/tilesets/Ground.png
index 0dac8fd..8d0b7b1 100644
Binary files a/assets/tilesets/Ground.png and b/assets/tilesets/Ground.png differ
diff --git a/src/assets/Ground.h b/src/assets/Ground.h
index a8c925e..2efb831 100644
--- a/src/assets/Ground.h
+++ b/src/assets/Ground.h
@@ -14,26 +14,29 @@ namespace assets {
/**
* Maps tiles to ground name
*/
- enum class Ground
+ enum Ground
{
- Dirt = 0,
- DirtVariation0 = 1,
- DirtVariation1 = 2,
- DirtVariation2 = 3,
- DirtVariation3 = 4,
- DirtVariation4 = 5,
- DirtVariation5 = 6,
- DirtVariation6 = 7,
- DirtVariation7 = 8,
- DirtVariation8 = 9,
+ None = 0,
+ Dirt = 1,
+ DirtVariation0 = 2,
+ DirtVariation1 = 3,
+ DirtVariation2 = 4,
+ DirtVariation3 = 5,
+ DirtVariation4 = 6,
+ DirtVariation5 = 7,
+ DirtVariation6 = 8,
+ DirtVariation7 = 9,
+ DirtVariation8 = 10,
- SoilCenter = 30,
+ SoilDry = 92,
- SoilWet = 36
+ SoilWet = 98,
+
+ Water = 180,
};
inline bool groundIsDirt(int cell) { return cell >= Ground::Dirt && cell <= Ground::DirtVariation8; }
- inline bool groundIsDrySoil(int cell) { return cell == Ground::SoilCenter; }
+ inline bool groundIsDrySoil(int cell) { return cell == Ground::SoilDry; }
inline bool groundIsWetSoil(int cell) { return cell == Ground::SoilWet; }
}
diff --git a/src/components/items/Axe.cpp b/src/components/items/Axe.cpp
new file mode 100644
index 0000000..c333375
--- /dev/null
+++ b/src/components/items/Axe.cpp
@@ -0,0 +1,43 @@
+/*
+ * Axe.cpp
+ *
+ * Created on: Dec 3, 2016
+ * Author: tibi
+ */
+
+#include
+#include
+#include
+
+namespace farmlands {
+namespace components {
+namespace items {
+
+Axe::Axe()
+{
+}
+
+Axe::~Axe()
+{
+}
+
+model::Component* Axe::clone()
+{
+ return new Axe();
+}
+
+void Axe::dump(unsigned level)
+{
+ for (unsigned i = 0; i < level; i++)
+ std::cout<<" ";
+
+ std::cout << " .Component: Axe\n";
+}
+
+void Axe::performAction(float x, float y, model::Direction d)
+{
+}
+
+} /* namespace items */
+} /* namespace components */
+} /* namespace farmlands */
diff --git a/src/components/items/Axe.h b/src/components/items/Axe.h
new file mode 100644
index 0000000..a8c0f9b
--- /dev/null
+++ b/src/components/items/Axe.h
@@ -0,0 +1,34 @@
+/*
+ * Axe.h
+ *
+ * Created on: Dec 3, 2016
+ * Author: tibi
+ */
+
+#ifndef COMPONENTS_ITEMS_AXE_H_
+#define COMPONENTS_ITEMS_AXE_H_
+
+#include
+#include
+
+namespace farmlands {
+namespace components {
+namespace items {
+
+ class Axe: public model::Component, public ITool
+ {
+ public:
+ Axe();
+ virtual ~Axe();
+
+ virtual model::Component* clone() override;
+ virtual void dump(unsigned level) override;
+
+ virtual void performAction(float x, float y, model::Direction d) override;
+ };
+
+} /* namespace items */
+} /* namespace components */
+} /* namespace farmlands */
+
+#endif /* COMPONENTS_ITEMS_AXE_H_ */
diff --git a/src/components/items/Giftable.cpp b/src/components/items/Giftable.cpp
index 4fdefaf..e876356 100644
--- a/src/components/items/Giftable.cpp
+++ b/src/components/items/Giftable.cpp
@@ -26,15 +26,8 @@ model::Component* Giftable::clone()
return new Giftable();
}
-bool Giftable::canGift(float x, float y, model::Direction d)
+void Giftable::performAction(float x, float y, model::Direction d)
{
- // TODO: implement Giftable::canGift
- return false;
-}
-
-void Giftable::offerGift(float x, float y, model::Direction d)
-{
- // TODO: implement Giftable::offerGift
}
void Giftable::dump(unsigned level)
diff --git a/src/components/items/Giftable.h b/src/components/items/Giftable.h
index 7da2f90..ae101b7 100644
--- a/src/components/items/Giftable.h
+++ b/src/components/items/Giftable.h
@@ -8,14 +8,14 @@
#ifndef CONTROLLER_ITEMS_GIFTABLE_H_
#define CONTROLLER_ITEMS_GIFTABLE_H_
+#include
#include
-#include
namespace farmlands {
namespace components {
namespace items {
- class Giftable: public model::Component
+ class Giftable: public model::Component, public ITool
{
public:
Giftable();
@@ -24,8 +24,7 @@ namespace items {
virtual model::Component* clone() override;
virtual void dump(unsigned level) override;
- bool canGift(float x, float y, model::Direction d);
- void offerGift(float x, float y, model::Direction d);
+ virtual void performAction(float x, float y, model::Direction d) override;
};
} /* namespace items */
diff --git a/src/components/items/Hoe.cpp b/src/components/items/Hoe.cpp
index d524fe3..e76b699 100644
--- a/src/components/items/Hoe.cpp
+++ b/src/components/items/Hoe.cpp
@@ -5,15 +5,23 @@
* Author: tibi
*/
+#include
+#include
#include
+#include