2024-01-25 17:29:33 +02:00
|
|
|
extends StoreClass
|
2024-03-17 01:14:31 +02:00
|
|
|
## Stores information about the house, its rooms and entities
|
2024-01-25 17:29:33 +02:00
|
|
|
|
2024-03-17 01:14:31 +02:00
|
|
|
const StoreClass = preload ("./store.gd")
|
2024-01-25 17:29:33 +02:00
|
|
|
|
2024-03-17 01:14:31 +02:00
|
|
|
## Type Room
|
|
|
|
## name: String
|
|
|
|
## corners: Vec2[]
|
|
|
|
## height: float
|
2024-01-25 17:29:33 +02:00
|
|
|
var rooms = []
|
2024-03-17 01:14:31 +02:00
|
|
|
## Type Entity
|
|
|
|
## id: String
|
|
|
|
## position: Vec3
|
|
|
|
## rotation: Vec3
|
|
|
|
## room: String
|
2024-01-25 17:29:33 +02:00
|
|
|
var entities = []
|
|
|
|
var align_position1: Vector3
|
|
|
|
var align_position2: Vector3
|
|
|
|
|
|
|
|
func _init():
|
|
|
|
_save_path = "user://house.json"
|
|
|
|
|
|
|
|
func clear():
|
2024-01-29 16:35:58 +02:00
|
|
|
rooms = []
|
|
|
|
entities = []
|
2024-01-25 17:29:33 +02:00
|
|
|
|
|
|
|
func get_room(name):
|
|
|
|
for room in rooms:
|
|
|
|
if room.name == name:
|
|
|
|
return room
|
|
|
|
return null
|