From 150aa99599aa903cebffb76c044fbd5b96b229d3 Mon Sep 17 00:00:00 2001 From: Naliwe GS <Naliwe GS> Date: Mon, 1 Aug 2016 00:36:37 +0200 Subject: [PATCH] Adding cellular automaton --- .idea.igem-quantifly/.idea/workspace.xml | 242 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------ Assets/Scenes/Main.unity | Bin 12728 -> 0 bytes Assets/Scripts/MapGeneration.meta | 9 +++++++++ Assets/Scripts/MapGeneration/Cell.cs | 25 +++++++++++++++++++++++++ Assets/Scripts/MapGeneration/Cell.cs.meta | 12 ++++++++++++ Assets/Scripts/MapGeneration/CellularAutomaton.cs | 13 +++++++++++++ Assets/Scripts/MapGeneration/CellularAutomaton.cs.meta | 12 ++++++++++++ Assets/Scripts/Utils/Map.cs | 39 +++++++++++++++++++++++++++++++++++++++ Assets/Scripts/Utils/Map.cs.meta | 12 ++++++++++++ 9 files changed, 238 insertions(+), 126 deletions(-) create mode 100644 Assets/Scripts/MapGeneration.meta create mode 100644 Assets/Scripts/MapGeneration/Cell.cs create mode 100644 Assets/Scripts/MapGeneration/Cell.cs.meta create mode 100644 Assets/Scripts/MapGeneration/CellularAutomaton.cs create mode 100644 Assets/Scripts/MapGeneration/CellularAutomaton.cs.meta create mode 100644 Assets/Scripts/Utils/Map.cs create mode 100644 Assets/Scripts/Utils/Map.cs.meta diff --git a/.idea.igem-quantifly/.idea/workspace.xml b/.idea.igem-quantifly/.idea/workspace.xml index 6e07fd2..969160e 100644 --- a/.idea.igem-quantifly/.idea/workspace.xml +++ b/.idea.igem-quantifly/.idea/workspace.xml @@ -2,10 +2,6 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" id="5ae8e509-4645-4305-8aec-662b1997deba" name="Default" comment=""> - <change type="DELETED" beforePath="$PROJECT_DIR$/../Assets/Scripts/GameManager.cs" afterPath="" /> - <change type="DELETED" beforePath="$PROJECT_DIR$/../Assets/Scripts/GameManager.cs.meta" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ProjectSettings/EditorBuildSettings.asset" afterPath="$PROJECT_DIR$/../ProjectSettings/EditorBuildSettings.asset" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ProjectSettings/ProjectSettings.asset" afterPath="$PROJECT_DIR$/../ProjectSettings/ProjectSettings.asset" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> </list> <ignored path="igem-quantifly.iws" /> @@ -26,56 +22,47 @@ <favorites_list name="igem-quantifly" /> </component> <component name="FileEditorManager"> - <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> - <file leaf-file-name="ObjectPool.cs" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/ObjectPool.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> - </provider> - </entry> - </file> - <file leaf-file-name="GameController.cs" pinned="false" current-in-tab="false"> - <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="28" selection-start-line="15" selection-start-column="28" selection-end-line="15" selection-end-column="28" /> - <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="{...}" /> - </folding> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="Player.cs" pinned="false" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/../Assets/Scripts/Player.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" /> - <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="{...}" /> - </folding> - </state> - </provider> - </entry> - </file> - </leaf> + <splitter split-orientation="horizontal" split-proportion="0.5"> + <split-first> + <leaf> + <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" /> + <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" /> + </folding> + </state> + </provider> + </entry> + </file> + </leaf> + </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"> + <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="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="{...}" /> + </folding> + </state> + </provider> + </entry> + </file> + </leaf> + </split-second> + </splitter> </component> <component name="Git.Settings"> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." /> @@ -87,14 +74,15 @@ <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/Utils/Map.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="x" value="-8" /> - <option name="y" value="-8" /> - <option name="width" value="1936" /> - <option name="height" value="1056" /> + <option name="width" value="1920" /> + <option name="height" value="1080" /> </component> <component name="ProjectInspectionProfilesVisibleTreeState"> <entry key="Project Default"> @@ -141,70 +129,7 @@ </navigator> <panes> <pane id="SolutionExplorer"> - <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> - </subPane> + <subPane /> <option name="show-file-system" value="false" /> </pane> </panes> @@ -213,6 +138,7 @@ <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.splitter.proportion" value="0.2" /> + <property name="SearchEverywhereHistoryKey" value="Cel	FILE	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"> @@ -251,12 +177,12 @@ <workItem from="1469990303599" duration="68000" /> <workItem from="1469991709912" duration="1654000" /> <workItem from="1469993497246" duration="1025000" /> - <workItem from="1469994566860" duration="5595000" /> + <workItem from="1469994566860" duration="8371000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> - <option name="totallyTimeSpent" value="8342000" /> + <option name="totallyTimeSpent" value="11118000" /> </component> <component name="TodoView"> <todo-panel id="selected-file"> @@ -268,10 +194,10 @@ </todo-panel> </component> <component name="ToolWindowManager"> - <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" /> + <frame x="0" y="0" width="1920" height="1080" extended-state="6" /> <editor active="true" /> <layout> - <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="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" /> @@ -292,6 +218,28 @@ <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" /> + <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="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="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="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="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="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="8" 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="9" 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="10" 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="11" 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="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="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="12" 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="4" side_tool="false" content_ui="tabs" /> + <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="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="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-to-restore> </component> <component name="Vcs.Log.UiProperties"> <option name="RECENTLY_FILTERED_USER_GROUPS"> @@ -415,5 +363,47 @@ </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/../Assets/Scripts/Utils/Map.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" /> + <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="{...}" /> + </folding> + </state> + </provider> + </entry> + <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" /> + <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" /> + </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="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="{...}" /> + </folding> + </state> + </provider> + </entry> </component> </project> \ No newline at end of file diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 3d342e3..c093d36 100644 Binary files a/Assets/Scenes/Main.unity and b/Assets/Scenes/Main.unity differ diff --git a/Assets/Scripts/MapGeneration.meta b/Assets/Scripts/MapGeneration.meta new file mode 100644 index 0000000..92aee5b --- /dev/null +++ b/Assets/Scripts/MapGeneration.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2c52723e47e2e36458f94fd1eb26750e +folderAsset: yes +timeCreated: 1470001199 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/MapGeneration/Cell.cs b/Assets/Scripts/MapGeneration/Cell.cs new file mode 100644 index 0000000..4be8067 --- /dev/null +++ b/Assets/Scripts/MapGeneration/Cell.cs @@ -0,0 +1,25 @@ +using Assets.Scripts.Utils; +using UnityEngine; + +namespace Assets.Scripts.MapGeneration +{ + public class Cell + { + #region Fields + + public TileType Type { get; set; } + public Vector2 Position { get; set; } + + #endregion + + #region Ctors + + public Cell(int x, int y, TileType type) + { + Type = type; + Position = new Vector2(x, y); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Scripts/MapGeneration/Cell.cs.meta b/Assets/Scripts/MapGeneration/Cell.cs.meta new file mode 100644 index 0000000..0e5c84a --- /dev/null +++ b/Assets/Scripts/MapGeneration/Cell.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 40375fbc1ac54974e9fa16e397eff04c +timeCreated: 1470002106 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/MapGeneration/CellularAutomaton.cs b/Assets/Scripts/MapGeneration/CellularAutomaton.cs new file mode 100644 index 0000000..0a84635 --- /dev/null +++ b/Assets/Scripts/MapGeneration/CellularAutomaton.cs @@ -0,0 +1,13 @@ +using Assets.Scripts.Utils; + +namespace Assets.Scripts.MapGeneration +{ + public class CellularAutomaton + { + #region Fields + + Map _map; + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Scripts/MapGeneration/CellularAutomaton.cs.meta b/Assets/Scripts/MapGeneration/CellularAutomaton.cs.meta new file mode 100644 index 0000000..a076aa4 --- /dev/null +++ b/Assets/Scripts/MapGeneration/CellularAutomaton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 812c9a190b66e0844b2ec7a792f22f97 +timeCreated: 1470001215 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Utils/Map.cs b/Assets/Scripts/Utils/Map.cs new file mode 100644 index 0000000..67323c5 --- /dev/null +++ b/Assets/Scripts/Utils/Map.cs @@ -0,0 +1,39 @@ +namespace Assets.Scripts.Utils +{ + public enum TileType + { + Default, + Wall, + Background + } + + public class Map + { + #region Fields + + public uint Columns { get; set; } + public uint Rows { get; set; } + + private TileType[,] _map; + + #endregion + + #region Ctors + + public Map(uint cols, uint rows) + { + Columns = cols; + Rows = rows; + + _map = new TileType[Columns, Rows]; + } + + #endregion + + public TileType this[uint x, uint y] + { + get { return _map[x, y]; } + set { _map[x, y] = value; } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Utils/Map.cs.meta b/Assets/Scripts/Utils/Map.cs.meta new file mode 100644 index 0000000..978835f --- /dev/null +++ b/Assets/Scripts/Utils/Map.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 55f31c89beca82248a7057f76f015038 +timeCreated: 1470001225 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- libgit2 0.27.0