From ceeb76d6769474c472d6803027dabb3f79a5b53b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leevi=20Gr=C3=B6nlund?= <lejugr@utu.fi>
Date: Sun, 3 Mar 2019 10:12:54 +0200
Subject: [PATCH] More code to resource classes

---
 Assets/Scripts/BerryBush.cs | 21 ++++++++++++++++++++-
 Assets/Scripts/Forest.cs    |  2 +-
 Assets/Scripts/Outcrop.cs   | 15 +++------------
 Assets/Scripts/Resource.cs  |  2 --
 4 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/Assets/Scripts/BerryBush.cs b/Assets/Scripts/BerryBush.cs
index fab9896..02598b2 100644
--- a/Assets/Scripts/BerryBush.cs
+++ b/Assets/Scripts/BerryBush.cs
@@ -14,7 +14,26 @@ public class BerryBush : Resource
 
     public override void refreshSprite()
     {
-
+        if (resources < 100)
+        {
+            //1 marjan sprite
+        }
+        else if (resources < 200)
+        {
+            //2 marjan sprite
+        }
+        else if (resources < 300)
+        {
+            //3 marjan sprite
+        }
+        else if (resources < 400)
+        {
+            //4 marjan sprite
+        }
+        else
+        {
+            // 5 marjan sprite
+        }
     }
 
     // Start is called before the first frame update
diff --git a/Assets/Scripts/Forest.cs b/Assets/Scripts/Forest.cs
index cc8347e..5677484 100644
--- a/Assets/Scripts/Forest.cs
+++ b/Assets/Scripts/Forest.cs
@@ -16,7 +16,7 @@ public class Forest : Resource
         }
         else
         {
-            growthspeed = 1;
+            growthspeed = 1f;
         }
     }
 
diff --git a/Assets/Scripts/Outcrop.cs b/Assets/Scripts/Outcrop.cs
index c89d689..080ceb8 100644
--- a/Assets/Scripts/Outcrop.cs
+++ b/Assets/Scripts/Outcrop.cs
@@ -2,20 +2,11 @@
 using System.Collections.Generic;
 using UnityEngine;
 
+// Luokka, joka vaatii collectoreilta 100 puuta ennen kuin Quarry voidaan luoda samaan pisteeseen kartalla
 public class Outcrop : Resource
 {
-    public override void checkExistence()
-    {
-        if (resources < 1)
-        {
-            Destroy(gameObject);
-        }
-    }
-
-    public override void refreshSprite()
-    {
-
-    }
+    public override void checkExistence() { }
+    public override void refreshSprite() { }
 
     // Start is called before the first frame update
     void Start()
diff --git a/Assets/Scripts/Resource.cs b/Assets/Scripts/Resource.cs
index 12e2222..651df7f 100644
--- a/Assets/Scripts/Resource.cs
+++ b/Assets/Scripts/Resource.cs
@@ -13,9 +13,7 @@ public abstract class Resource : MonoBehaviour
 
     public int getAmount()
     {
-        //r.setAmount(ref.getAmount() - extraction);
         return resources;
-
     }
     
     public int extractResource(int amount)
-- 
GitLab