/// <summary> /// Processes the input for the landmark tool. /// </summary> void ProcessInputForLandmarkTool() { if (dragInitiated) { Rect r; bool completed = ProcessInputForRectangleCreation(out r); floorController.CreateLandmark(r, !completed); } }
/// <summary> /// Overwrites this floor's content with JSON object root. /// </summary> /// <param name = "api">The FloorController.</param> /// <param name="root">Root.</param> public void FromJSON(FloorController api, JSONNode root) { if (root == null) { return; } floorId = root["floor_id"]; floorName = root["floor_name"]; floorOrder = root["floor_order"]; libraryId = root["library"]; if (api == null) { // Not ready to expand yet! floorJSONCache = root.ToString(); return; } aisles.Clear(); aisleAreas.Clear(); walls.Clear(); landmarks.Clear(); foreach (JSONObject obj in root["aisles"].AsArray) { Aisle aisle = api.CreateAisle(Rect.zero, false, true); aisle.FromJSON(api, obj); } foreach (JSONObject obj in root["aisle_areas"].AsArray) { AisleArea aisleArea = api.CreateAisleArea(Rect.zero, false, true); aisleArea.FromJSON(api, obj); } foreach (JSONObject obj in root["walls"].AsArray) { Wall wall = api.CreateWall(Vector2.zero, Vector2.zero, false, true); wall.FromJSON(api, obj); } foreach (JSONObject obj in root["landmarks"].AsArray) { Landmark landmark = api.CreateLandmark(Rect.zero, false, true); landmark.FromJSON(api, obj); } }