Commit 1ba11f7e by Naliwe GS

Almost done on cellular automaton. TODO: find better delegates

parent 150aa995
......@@ -3,6 +3,12 @@
<component name="ChangeListManager">
<list default="true" id="5ae8e509-4645-4305-8aec-662b1997deba" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/riderModule.iml" afterPath="$PROJECT_DIR$/riderModule.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Assets/Scripts/GameController.cs" afterPath="$PROJECT_DIR$/../Assets/Scripts/GameController.cs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs" afterPath="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs" afterPath="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs" afterPath="$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs" afterPath="$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs" />
</list>
<ignored path="igem-quantifly.iws" />
<ignored path=".idea/workspace.xml" />
......@@ -28,12 +34,26 @@
<file leaf-file-name="CellularAutomaton.cs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
<state relative-caret-position="432">
<caret line="99" column="64" selection-start-line="99" selection-start-column="64" selection-end-line="99" selection-end-column="64" />
<folding>
<marker date="1470002106446" expanded="true" signature="67:180" ph="{...}" />
<marker date="1470002106446" expanded="true" signature="104:178" ph="{...}" />
<marker date="1470002106446" expanded="true" signature="119:172" ph="Fields" />
<marker date="1470401124813" expanded="true" signature="6:120" ph="..." />
<marker date="1470401124813" expanded="true" signature="6:139" ph="..." />
<marker date="1470401124813" expanded="true" signature="179:3393" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="221:600" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="280:325" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="380:425" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="493:594" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="636:3391" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="651:913" ph="Delegates" />
<marker date="1470401124813" expanded="true" signature="921:1183" ph="Fields" />
<marker date="1470401124813" expanded="true" signature="1193:1686" ph="Ctors" />
<marker date="1470401124813" expanded="true" signature="1304:1668" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="1698:3385" ph="Methods" />
<marker date="1470401124813" expanded="true" signature="1741:2113" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="2189:2983" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3048:3110" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3175:3365" ph="{...}" />
</folding>
</state>
</provider>
......@@ -43,18 +63,18 @@
</split-first>
<split-second>
<leaf>
<file leaf-file-name="Cell.cs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs">
<file leaf-file-name="Map.cs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="17" selection-start-line="22" selection-start-column="17" selection-end-line="22" selection-end-column="17" />
<state relative-caret-position="731">
<caret line="43" column="38" selection-start-line="43" selection-start-column="38" selection-end-line="43" selection-end-column="38" />
<folding>
<marker date="1470002653164" expanded="true" signature="6:46" ph="..." />
<marker date="1470002653164" expanded="true" signature="86:437" ph="{...}" />
<marker date="1470002653164" expanded="true" signature="110:435" ph="{...}" />
<marker date="1470002653164" expanded="true" signature="125:249" ph="Fields" />
<marker date="1470002653164" expanded="true" signature="259:429" ph="Ctors" />
<marker date="1470002653164" expanded="true" signature="322:409" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="30:899" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="57:119" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="141:897" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="156:307" ph="Fields" />
<marker date="1470398652139" expanded="true" signature="317:746" ph="Ctors" />
<marker date="1470398652139" expanded="true" signature="372:726" ph="{...}" />
</folding>
</state>
</provider>
......@@ -71,18 +91,20 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/GameController.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/Player.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/GameController.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs" />
<option value="$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="width" value="1920" />
<option name="height" value="1080" />
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1936" />
<option name="height" value="1056" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
......@@ -129,16 +151,105 @@
</navigator>
<panes>
<pane id="SolutionExplorer">
<subPane />
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerViewPane$ProjectViewPaneTreeStructure$createRoot$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="igem-quantifly" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assembly-CSharp" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assets" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Scripts" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerViewPane$ProjectViewPaneTreeStructure$createRoot$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="igem-quantifly" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assembly-CSharp" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assets" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Scripts" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Utils" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerViewPane$ProjectViewPaneTreeStructure$createRoot$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="igem-quantifly" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assembly-CSharp" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assets" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Scripts" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MapGeneration" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerViewPane$ProjectViewPaneTreeStructure$createRoot$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="igem-quantifly" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Assembly-CSharp" />
<option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
</PATH_ELEMENT>
</PATH>
</subPane>
<option name="show-file-system" value="false" />
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/../igem-quantifly.sln" />
<property name="settings.editor.selected.configurable" value="preferences.sourceCode.C#" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="SearchEverywhereHistoryKey" value="Cel&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/MapGeneration/Cell.cs" />
<property name="SearchEverywhereHistoryKey" value="GC&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/GameController.cs&#10;Cel&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/MapGeneration/CellularAutomaton.cs&#10;C&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/MapGeneration/CellularAutomaton.cs&#10;Map&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/Utils/Map.cs&#10;:w&#9;null&#9;null&#10;Ce&#9;FILE&#9;file://G:/Code/Unity/igem-quantifly/Assets/Scripts/MapGeneration/Cell.cs" />
</component>
<component name="RunManager" selected=".NET Project.Default">
<configuration default="true" type="DotNetProject" factoryName=".NET Project">
......@@ -178,11 +289,13 @@
<workItem from="1469991709912" duration="1654000" />
<workItem from="1469993497246" duration="1025000" />
<workItem from="1469994566860" duration="8371000" />
<workItem from="1470317006204" duration="284000" />
<workItem from="1470317331087" duration="15978000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="11118000" />
<option name="totallyTimeSpent" value="27380000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
......@@ -194,29 +307,29 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1920" height="1080" extended-state="6" />
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1515625" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Errors in solution" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Build" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="UnitTesting" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="NuGet" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="NuGet" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32997987" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1515625" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Build" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
<layout-to-restore>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
......@@ -254,153 +367,206 @@
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="1" />
<option name="time" value="2" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="21" selection-start-line="4" selection-start-column="21" selection-end-line="4" selection-end-column="21" />
<folding />
<state relative-caret-position="238">
<caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<folding>
<marker date="1470401124813" expanded="true" signature="6:120" ph="..." />
<marker date="1470401124813" expanded="true" signature="6:139" ph="..." />
<marker date="1470401124813" expanded="true" signature="179:3393" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="221:600" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="280:325" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="380:425" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="493:594" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="636:3391" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="651:913" ph="Delegates" />
<marker date="1470401124813" expanded="true" signature="921:1183" ph="Fields" />
<marker date="1470401124813" expanded="true" signature="1193:1686" ph="Ctors" />
<marker date="1470401124813" expanded="true" signature="1304:1668" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="1698:3385" ph="Methods" />
<marker date="1470401124813" expanded="true" signature="1741:2113" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="2189:2983" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3048:3110" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3175:3365" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="408">
<caret line="24" column="0" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding>
<marker date="1469998228121" expanded="true" signature="6:71" ph="..." />
<marker date="1469998228121" expanded="true" signature="103:973" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="133:971" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="309:354" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="383:654" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="699:965" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="6:46" ph="..." />
<marker date="1470317011486" expanded="true" signature="86:437" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="110:435" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="125:249" ph="Fields" />
<marker date="1470317011486" expanded="true" signature="259:429" ph="Ctors" />
<marker date="1470317011486" expanded="true" signature="322:409" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="18" />
<folding />
<state relative-caret-position="136">
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
<folding>
<marker date="1470401124813" expanded="true" signature="6:120" ph="..." />
<marker date="1470401124813" expanded="true" signature="6:139" ph="..." />
<marker date="1470401124813" expanded="true" signature="179:3393" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="221:600" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="280:325" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="380:425" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="493:594" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="636:3391" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="651:913" ph="Delegates" />
<marker date="1470401124813" expanded="true" signature="921:1183" ph="Fields" />
<marker date="1470401124813" expanded="true" signature="1193:1686" ph="Ctors" />
<marker date="1470401124813" expanded="true" signature="1304:1668" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="1698:3385" ph="Methods" />
<marker date="1470401124813" expanded="true" signature="1741:2113" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="2189:2983" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3048:3110" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3175:3365" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="17" selection-start-line="22" selection-start-column="17" selection-end-line="22" selection-end-column="17" />
<folding>
<marker date="1470317011486" expanded="true" signature="6:46" ph="..." />
<marker date="1470317011486" expanded="true" signature="86:437" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="110:435" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="125:249" ph="Fields" />
<marker date="1470317011486" expanded="true" signature="259:429" ph="Ctors" />
<marker date="1470317011486" expanded="true" signature="322:409" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" />
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<marker date="1469998228121" expanded="true" signature="6:71" ph="..." />
<marker date="1469998228121" expanded="true" signature="103:973" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="133:971" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="309:354" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="383:654" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="699:965" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" />
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" />
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" />
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Player.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="8" selection-start-line="22" selection-start-column="8" selection-end-line="22" selection-end-column="8" />
<folding />
<state relative-caret-position="255">
<caret line="15" column="0" selection-start-line="15" selection-start-column="0" selection-end-line="15" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs">
<entry file="file://$USER_HOME$/AppData/Local/JetBrains/Shared/v06/DecompilerCache/decompiler/F6949EC5-53D4-4DE3-9F54-5BAB8EBF397B/bf/c7df5298/Vector2.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="612">
<caret line="36" column="28" selection-start-line="36" selection-start-column="28" selection-end-line="36" selection-end-column="28" />
<folding>
<marker date="1469998228121" expanded="true" signature="6:71" ph="..." />
<marker date="1469998228121" expanded="true" signature="103:973" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="133:971" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="309:354" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="383:654" ph="{...}" />
<marker date="1469998228121" expanded="true" signature="699:965" ph="{...}" />
</folding>
<state relative-caret-position="442">
<caret line="62" column="4" selection-start-line="62" selection-start-column="4" selection-end-line="62" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameController.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" column="28" selection-start-line="15" selection-start-column="28" selection-end-line="15" selection-end-column="28" />
<state relative-caret-position="357">
<caret line="21" column="0" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding>
<marker date="1469996328037" expanded="true" signature="6:46" ph="..." />
<marker date="1469996328037" expanded="true" signature="72:560" ph="{...}" />
<marker date="1469996328037" expanded="true" signature="122:558" ph="{...}" />
<marker date="1469996328037" expanded="true" signature="323:509" ph="{...}" />
<marker date="1469996328037" expanded="true" signature="532:552" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="6:46" ph="..." />
<marker date="1470317011486" expanded="true" signature="86:437" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="110:435" ph="{...}" />
<marker date="1470317011486" expanded="true" signature="125:249" ph="Fields" />
<marker date="1470317011486" expanded="true" signature="259:429" ph="Ctors" />
<marker date="1470317011486" expanded="true" signature="322:409" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Player.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/GameController.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" column="0" selection-start-line="15" selection-start-column="0" selection-end-line="15" selection-end-column="0" />
<state relative-caret-position="374">
<caret line="22" column="37" selection-start-line="22" selection-start-column="37" selection-end-line="22" selection-end-column="37" />
<folding>
<marker date="1469999977079" expanded="true" signature="44:454" ph="{...}" />
<marker date="1469999977079" expanded="true" signature="86:452" ph="{...}" />
<marker date="1469999977079" expanded="true" signature="146:212" ph="{...}" />
<marker date="1469999977079" expanded="true" signature="235:446" ph="{...}" />
<marker date="1470399191660" expanded="true" signature="6:82" ph="..." />
<marker date="1470399191660" expanded="true" signature="108:791" ph="{...}" />
<marker date="1470399191660" expanded="true" signature="158:789" ph="{...}" />
<marker date="1470399191660" expanded="true" signature="426:716" ph="{...}" />
<marker date="1470399191660" expanded="true" signature="739:783" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" column="29" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
<state relative-caret-position="238">
<caret line="14" column="8" selection-start-line="14" selection-start-column="8" selection-end-line="14" selection-end-column="8" />
<folding>
<marker date="1470001815596" expanded="true" signature="30:667" ph="{...}" />
<marker date="1470001815596" expanded="true" signature="57:119" ph="{...}" />
<marker date="1470001815596" expanded="true" signature="141:665" ph="{...}" />
<marker date="1470001815596" expanded="true" signature="156:307" ph="Fields" />
<marker date="1470001815596" expanded="true" signature="317:514" ph="Ctors" />
<marker date="1470001815596" expanded="true" signature="372:494" ph="{...}" />
<marker date="1470399191626" expanded="true" signature="6:71" ph="..." />
<marker date="1470399191626" expanded="true" signature="103:924" ph="{...}" />
<marker date="1470399191626" expanded="true" signature="133:922" ph="{...}" />
<marker date="1470399191626" expanded="true" signature="309:605" ph="{...}" />
<marker date="1470399191626" expanded="true" signature="650:916" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/Map.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
<state relative-caret-position="731">
<caret line="43" column="38" selection-start-line="43" selection-start-column="38" selection-end-line="43" selection-end-column="38" />
<folding>
<marker date="1470002106446" expanded="true" signature="67:180" ph="{...}" />
<marker date="1470002106446" expanded="true" signature="104:178" ph="{...}" />
<marker date="1470002106446" expanded="true" signature="119:172" ph="Fields" />
<marker date="1470398652139" expanded="true" signature="30:899" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="57:119" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="141:897" ph="{...}" />
<marker date="1470398652139" expanded="true" signature="156:307" ph="Fields" />
<marker date="1470398652139" expanded="true" signature="317:746" ph="Ctors" />
<marker date="1470398652139" expanded="true" signature="372:726" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/Cell.cs">
<entry file="file://$PROJECT_DIR$/../Assets/Scripts/MapGeneration/CellularAutomaton.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="17" selection-start-line="22" selection-start-column="17" selection-end-line="22" selection-end-column="17" />
<state relative-caret-position="432">
<caret line="99" column="64" selection-start-line="99" selection-start-column="64" selection-end-line="99" selection-end-column="64" />
<folding>
<marker date="1470002653164" expanded="true" signature="6:46" ph="..." />
<marker date="1470002653164" expanded="true" signature="86:437" ph="{...}" />
<marker date="1470002653164" expanded="true" signature="110:435" ph="{...}" />
<marker date="1470002653164" expanded="true" signature="125:249" ph="Fields" />
<marker date="1470002653164" expanded="true" signature="259:429" ph="Ctors" />
<marker date="1470002653164" expanded="true" signature="322:409" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="6:120" ph="..." />
<marker date="1470401124813" expanded="true" signature="6:139" ph="..." />
<marker date="1470401124813" expanded="true" signature="179:3393" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="221:600" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="280:325" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="380:425" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="493:594" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="636:3391" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="651:913" ph="Delegates" />
<marker date="1470401124813" expanded="true" signature="921:1183" ph="Fields" />
<marker date="1470401124813" expanded="true" signature="1193:1686" ph="Ctors" />
<marker date="1470401124813" expanded="true" signature="1304:1668" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="1698:3385" ph="Methods" />
<marker date="1470401124813" expanded="true" signature="1741:2113" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="2189:2983" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3048:3110" ph="{...}" />
<marker date="1470401124813" expanded="true" signature="3175:3365" ph="{...}" />
</folding>
</state>
</provider>
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$USER_HOME$/AppData/Local/JetBrains/Shared/v06/DecompilerCache/decompiler/F6949EC5-53D4-4DE3-9F54-5BAB8EBF397B/bf/c7df5298/Vector2.cs">
<sourceFolder url="file://$USER_HOME$/AppData/Local/JetBrains/Shared/v06/DecompilerCache/decompiler/F6949EC5-53D4-4DE3-9F54-5BAB8EBF397B/bf/c7df5298/Vector2.cs" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/..">
<sourceFolder url="file://$MODULE_DIR$/.." isTestSource="false" />
</content>
......
fileFormatVersion: 2
guid: 868ebc93d24347047afd4a4810d2a648
timeCreated: 1470316413
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0c5304ecebff7f94ba6393ce4aa43046
timeCreated: 1470316536
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
using Assets.Scripts.Utils;
using Assets.Scripts.MapGeneration;
using Assets.Scripts.Utils;
using UnityEngine;
namespace Assets.Scripts
......@@ -7,19 +8,30 @@ namespace Assets.Scripts
{
public static int PoolSize = 256;
private Map _map;
private ObjectPool _pooledWalls;
private ObjectPool _pooledActors;
private ObjectPool _pooledProjectiles;
private CellularAutomaton _ca;
void Start()
{
_map = new Map(128, 128);
_pooledActors = new ObjectPool(PoolSize);
_pooledProjectiles = new ObjectPool(PoolSize);
_pooledWalls = new ObjectPool(PoolSize);
_ca = new CellularAutomaton(_map, TileType.Wall);
}
void Update()
{
_ca.Step();
}
}
}
\ No newline at end of file
using Assets.Scripts.Utils;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Assets.Scripts.Utils;
using UnityEngine;
namespace Assets.Scripts.MapGeneration
{
internal class DefaultCellDelegates
{
public static bool DefaultCanGrow(Cell cell)
{
return true;
}
public static bool DefaultWillGrow(Cell cell)
{
return true;
}
public static Cell DefaultPickTarget(Map map, Cell origin)
{
return CellularAutomaton.GetNeighbors(map, origin).FirstOrDefault();
}
}
public class CellularAutomaton
{
#region Delegates
public delegate IEnumerable<Cell> Filter(Map map);
public delegate bool CanGrow(Cell cell);
public delegate bool WillGrow(Cell cell);
public delegate Cell Picktarget(Map map, Cell origin);
#endregion
#region Fields
Map _map;
private Map _map;
private List<Cell> _toProcess;
private CanGrow _canGrowRule;
private WillGrow _willGrowRule;
private Picktarget _pickTargetRule;
private TileType _targetType;
#endregion
#region Ctors
public CellularAutomaton(Map map, TileType targetType, int startX = 0, int startY = 0)
{
_map = map;
_targetType = targetType;
_canGrowRule = DefaultCellDelegates.DefaultCanGrow;
_willGrowRule = DefaultCellDelegates.DefaultWillGrow;
_pickTargetRule = DefaultCellDelegates.DefaultPickTarget;
_toProcess = new List<Cell> {new Cell(startX, startY, targetType)};
}
#endregion
#region Methods
public void Step()
{
var newCells = new List<Cell>();
foreach (var cell in _toProcess)
{
if (!_canGrowRule(cell) || !_willGrowRule(cell))
continue;
Grow(_pickTargetRule(_map, cell), _targetType);
newCells.Add(cell);
}
_toProcess = newCells;
}
public static IEnumerable<Cell> GetNeighbors(Map map, Cell origin)
{
var ret = new List<Cell>();
for (var x = origin.Position.x - 1; x <= origin.Position.x + 1; x++)
{
for (var y = origin.Position.y - 1; y <= origin.Position.y + 1; y++)
{
Debug.Log(string.Format("Processing cell {0}:{1}", x, y));
if ((Math.Abs(x - origin.Position.x) > .1f || Math.Abs(y - origin.Position.y) > .1f)
&& IsInMapRange(map, (int) x, (int) y) && map[(uint) x, (uint) y] != origin.Type)
{
ret.Add(new Cell((int) x, (int) y, map[(uint) x, (uint) y]));
}
}
}
Debug.Log(string.Format("{0}", ret.Count));
return ret;
}
private void Grow(Cell targetCell, TileType targetType)
{
targetCell.Type = targetType;
}
private static bool IsInMapRange(Map map, int x, int y)
{
Debug.Log(string.Format("Is cell {0}:{1} in map range", x, y));
return (x >= 0 && x < map.Columns &&
y >= 0 && y < map.Rows);
}
#endregion
}
......
......@@ -26,6 +26,14 @@
Rows = rows;
_map = new TileType[Columns, Rows];
for (int x = 0; x < _map.GetLength(0); x++)
{
for (int y = 0; y < _map.GetLength(1); y++)
{
_map[x, y] = TileType.Default;
}
}
}
#endregion
......
......@@ -14,10 +14,6 @@ namespace Assets.Scripts.Utils
public ObjectPool(int size)
{
Size = size;
}
public void Start()
{
Pool = new List<GameObject>();
for (var i = 0; i < Pool.Count; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment