diff --git a/.idea/.idea.igem-quantifly/.idea/.name b/.idea/.idea.igem-quantifly/.idea/.name
new file mode 100644
index 0000000..8a570ea
--- /dev/null
+++ b/.idea/.idea.igem-quantifly/.idea/.name
@@ -0,0 +1 @@
+igem-quantifly
\ No newline at end of file
diff --git a/.idea/.idea.igem-quantifly/.idea/modules.xml b/.idea/.idea.igem-quantifly/.idea/modules.xml
new file mode 100644
index 0000000..bbb5212
--- /dev/null
+++ b/.idea/.idea.igem-quantifly/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.igem-quantifly/.idea/vcs.xml b/.idea/.idea.igem-quantifly/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/.idea/.idea.igem-quantifly/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.igem-quantifly/.idea/workspace.xml b/.idea/.idea.igem-quantifly/.idea/workspace.xml
new file mode 100644
index 0000000..d3e8b24
--- /dev/null
+++ b/.idea/.idea.igem-quantifly/.idea/workspace.xml
@@ -0,0 +1,528 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1474120888466
+
+
+ 1474120888466
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.igem-quantifly/riderModule.iml b/.idea/.idea.igem-quantifly/riderModule.iml
new file mode 100644
index 0000000..571914f
--- /dev/null
+++ b/.idea/.idea.igem-quantifly/riderModule.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Assets/Prefabs/Coin.prefab b/Assets/Prefabs/Coin.prefab
new file mode 100644
index 0000000..5d36fa4
Binary files /dev/null and b/Assets/Prefabs/Coin.prefab differ
diff --git a/Assets/Prefabs/Coin.prefab.meta b/Assets/Prefabs/Coin.prefab.meta
new file mode 100644
index 0000000..b3a254e
--- /dev/null
+++ b/Assets/Prefabs/Coin.prefab.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f6cb68588aa5f4d55ad0173e13f27e75
+timeCreated: 1470581493
+licenseType: Free
+NativeFormatImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs
index 8d59ea5..b2f43fb 100644
--- a/Assets/Scripts/GameController.cs
+++ b/Assets/Scripts/GameController.cs
@@ -1,9 +1,26 @@
using Assets.Scripts.MapGeneration;
using Assets.Scripts.Utils;
using UnityEngine;
+using System;
namespace Assets.Scripts
{
+ internal class CADelegates
+ {
+ static System.Random r = new System.Random();
+
+ public static bool CanGrow(Cell cell)
+ {
+
+ if (cell.Position.x == 0)
+ return true;
+ if (cell.Position.x % 10 == 0)
+ return (cell.Position.y < 16 && (cell.Position.y * r.Next(100)) / 100
+ < 50);
+ return false;
+ }
+ }
+
public class GameController : MonoBehaviour
{
public static int PoolSize = 256;
@@ -25,8 +42,7 @@ namespace Assets.Scripts
_pooledWalls = new ObjectPool(PoolSize);
_ca = new CellularAutomaton(_map, TileType.Wall);
-
-
+ _ca.CanGrowRule = CADelegates.CanGrow;
}
void Update()
diff --git a/Assets/Scripts/MapGeneration/CellularAutomaton.cs b/Assets/Scripts/MapGeneration/CellularAutomaton.cs
index 5ecf6c6..97c274a 100644
--- a/Assets/Scripts/MapGeneration/CellularAutomaton.cs
+++ b/Assets/Scripts/MapGeneration/CellularAutomaton.cs
@@ -44,9 +44,9 @@ namespace Assets.Scripts.MapGeneration
private Map _map;
private List _toProcess;
- private CanGrow _canGrowRule;
- private WillGrow _willGrowRule;
- private Picktarget _pickTargetRule;
+ public CanGrow CanGrowRule;
+ public WillGrow WillGrowRule;
+ public Picktarget PickTargetRule;
private TileType _targetType;
@@ -59,9 +59,9 @@ namespace Assets.Scripts.MapGeneration
_map = map;
_targetType = targetType;
- _canGrowRule = DefaultCellDelegates.DefaultCanGrow;
- _willGrowRule = DefaultCellDelegates.DefaultWillGrow;
- _pickTargetRule = DefaultCellDelegates.DefaultPickTarget;
+ CanGrowRule = DefaultCellDelegates.DefaultCanGrow;
+ WillGrowRule = DefaultCellDelegates.DefaultWillGrow;
+ PickTargetRule = DefaultCellDelegates.DefaultPickTarget;
_toProcess = new List {new Cell(startX, startY, targetType)};
}
@@ -76,10 +76,10 @@ namespace Assets.Scripts.MapGeneration
foreach (var cell in _toProcess)
{
- if (!_canGrowRule(cell) || !_willGrowRule(cell))
+ if (!CanGrowRule(cell) || !WillGrowRule(cell))
continue;
- Grow(_pickTargetRule(_map, cell), _targetType);
+ Grow(PickTargetRule(_map, cell), _targetType);
newCells.Add(cell);
}
diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset
index 79d37c7..8c694b0 100644
Binary files a/ProjectSettings/GraphicsSettings.asset and b/ProjectSettings/GraphicsSettings.asset differ
diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset
index fdca12f..27879a6 100644
Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ
diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt
index 069bc88..96b25e7 100644
--- a/ProjectSettings/ProjectVersion.txt
+++ b/ProjectSettings/ProjectVersion.txt
@@ -1,2 +1,2 @@
-m_EditorVersion: 5.4.0f3
+m_EditorVersion: 5.4.1f1
m_StandardAssetsVersion: 0
| |