# Placement System

The placement system is one of the core parts of the grid building system:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeBEPa8gPRe2VD0pQxu81DaGhnshq1p4WtMBspOa0KZeyTOp3qx771iX9a2VQ0EhYLTJR-p4QotK0VTZxB91aiZx79v2jaZc48kvz0fYQ99-CsBhp42U8ekWwIIQdonk3LsjoYd?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

It is a state based system that handles place, load, move, rotate and remove actions. Currently there are 5 states implemented which all have a corresponding function call in the PlacementSystem script.

<table data-full-width="false"><thead><tr><th width="148">State</th><th width="252">Method call in Placement System</th><th>Description</th></tr></thead><tbody><tr><td>PlacementState</td><td><p>StartPlacement</p><p>(string id)</p></td><td><p>Handles placing new objects on the grid.</p><p>Buttons in the shop ui will trigger the StartPlacement Method</p></td></tr><tr><td>LoadObject-PlacementState</td><td><p>InitializeLoadedObject</p><p>(PlaceableObjectData podata)</p></td><td>Similar to the Placement state, only that it uses data from the saveFile to rebuild the scene as it was saved on the last game run.</td></tr><tr><td>MoveState</td><td><p>StartMoving</p><p>(PlacedObject target)</p></td><td>Triggered by the move button in the action tooltip when you hold on a placed object. Enables moving and rotating the selected object.</td></tr><tr><td>RemoveState</td><td><p>StartRemoving</p><p>(GridDataType gridType)</p></td><td><p>Triggers removal of only the selected type.</p><p>Objects of all other types will be hidden so you have a better view of what to remove.</p></td></tr><tr><td>RemoveAllState</td><td>StartRemovingAll()</td><td><p>Triggers removing all grid types at once.</p><p>When you select a grid position while in remove all state, all objects on this position will be removed</p></td></tr></tbody></table>

Note: The Rotate Action is handled directly in each state where it is needed.
