Line data Source code
1 : // Code generated by "ruins gencomponents". DO NOT EDIT.
2 :
3 : package components
4 :
5 : import "github.com/mlange-42/ark/ecs"
6 :
7 : // EntitySpec is the specification used to create an entity.
8 : // It defines the set of components to attach, which AddEntity converts into an ECS entity.
9 : type EntitySpec struct {
10 : Name *Name
11 : RawID *RawID
12 : Description *Description
13 : HP *HP
14 : Consumable *Consumable
15 : Material *Material
16 : FireStarter *FireStarter
17 : EscapeDevice *EscapeDevice
18 : CubeCore *CubeCore
19 : Perishable *Perishable
20 : WeightCapacity *WeightCapacity
21 : Melee *Melee
22 : Fire *Fire
23 : Value *Value
24 : Weight *Weight
25 : Recipe *Recipe
26 : Wearable *Wearable
27 : Abilities *Abilities
28 : Ammo *Ammo
29 : CubeModule *CubeModule
30 : Deployable *Deployable
31 : LocationInBackpack *LocationInBackpack
32 : LocationEquipped *LocationEquipped
33 : LocationOnField *LocationOnField
34 : LocationInStorage *LocationInStorage
35 : LocationStowed *LocationStowed
36 : LocationInstalled *LocationInstalled
37 : Tile *Tile
38 : SoloAI *SoloAI
39 : Camera *Camera
40 : Position *Position
41 : GridElement *GridElement
42 : SpriteRender *SpriteRender
43 : BlockView *BlockView
44 : BlockPass *BlockPass
45 : PassCost *PassCost
46 : Door *Door
47 : Pose *Pose
48 : Item *Item
49 : Prop *Prop
50 : Cube *Cube
51 : FuelTank *FuelTank
52 : Deployed *Deployed
53 : LightSource *LightSource
54 : Interactable *Interactable
55 : Unsearched *Unsearched
56 : VisualEffects *VisualEffects
57 : TileEnvironment *TileEnvironment
58 : HeatSource *HeatSource
59 : Burning *Burning
60 : StageBound *StageBound
61 : StageField *StageField
62 : SeamlessBand *SeamlessBand
63 : PortalConnection *PortalConnection
64 : DungeonEntrance *DungeonEntrance
65 : Suspended *Suspended
66 : Player *Player
67 : Profession *Profession
68 : Hunger *Hunger
69 : Fatigue *Fatigue
70 : Sleeping *Sleeping
71 : Bedding *Bedding
72 : Wallet *Wallet
73 : FactionAlly *FactionAlly
74 : FactionEnemy *FactionEnemy
75 : FactionNeutral *FactionNeutral
76 : Dialog *Dialog
77 : Dead *Dead
78 : TurnBased *TurnBased
79 : HealthStatus *HealthStatus
80 : Skills *Skills
81 : StateChangeRequest *StateChangeRequest
82 : StatsChanged *StatsChanged
83 : WeightDirty *WeightDirty
84 : ProvidesHealing *ProvidesHealing
85 : ProvidesNutrition *ProvidesNutrition
86 : InflictsDamage *InflictsDamage
87 : Remedy *Remedy
88 : Book *Book
89 : CommandTable *CommandTable
90 : DropTable *DropTable
91 : Activity *Activity
92 : LastActivity *LastActivity
93 : GameLog *GameLog
94 : Dungeon *Dungeon
95 : TurnState *TurnState
96 : SpatialIndex *SpatialIndex
97 : WeaponSelection *WeaponSelection
98 : GameTime *GameTime
99 : Weather *Weather
100 : PlayTime *PlayTime
101 : VisionState *VisionState
102 : UserSettings *UserSettings
103 : RunStats *RunStats
104 : }
105 :
106 : // Components is the bundle of ECS component handles.
107 : // It holds a typed *ecs.Map[T] for each component type, used by Add/Has/Get and queries.
108 : type Components struct {
109 : Name *ecs.Map[Name]
110 : RawID *ecs.Map[RawID]
111 : Description *ecs.Map[Description]
112 : HP *ecs.Map[HP]
113 : Consumable *ecs.Map[Consumable]
114 : Material *ecs.Map[Material]
115 : FireStarter *ecs.Map[FireStarter]
116 : EscapeDevice *ecs.Map[EscapeDevice]
117 : CubeCore *ecs.Map[CubeCore]
118 : Perishable *ecs.Map[Perishable]
119 : WeightCapacity *ecs.Map[WeightCapacity]
120 : Melee *ecs.Map[Melee]
121 : Fire *ecs.Map[Fire]
122 : Value *ecs.Map[Value]
123 : Weight *ecs.Map[Weight]
124 : Recipe *ecs.Map[Recipe]
125 : Wearable *ecs.Map[Wearable]
126 : Abilities *ecs.Map[Abilities]
127 : Ammo *ecs.Map[Ammo]
128 : CubeModule *ecs.Map[CubeModule]
129 : Deployable *ecs.Map[Deployable]
130 : LocationInBackpack *ecs.Map[LocationInBackpack]
131 : LocationEquipped *ecs.Map[LocationEquipped]
132 : LocationOnField *ecs.Map[LocationOnField]
133 : LocationInStorage *ecs.Map[LocationInStorage]
134 : LocationStowed *ecs.Map[LocationStowed]
135 : LocationInstalled *ecs.Map[LocationInstalled]
136 : Tile *ecs.Map[Tile]
137 : SoloAI *ecs.Map[SoloAI]
138 : Camera *ecs.Map[Camera]
139 : Position *ecs.Map[Position]
140 : GridElement *ecs.Map[GridElement]
141 : SpriteRender *ecs.Map[SpriteRender]
142 : BlockView *ecs.Map[BlockView]
143 : BlockPass *ecs.Map[BlockPass]
144 : PassCost *ecs.Map[PassCost]
145 : Door *ecs.Map[Door]
146 : Pose *ecs.Map[Pose]
147 : Item *ecs.Map[Item]
148 : Prop *ecs.Map[Prop]
149 : Cube *ecs.Map[Cube]
150 : FuelTank *ecs.Map[FuelTank]
151 : Deployed *ecs.Map[Deployed]
152 : LightSource *ecs.Map[LightSource]
153 : Interactable *ecs.Map[Interactable]
154 : Unsearched *ecs.Map[Unsearched]
155 : VisualEffects *ecs.Map[VisualEffects]
156 : TileEnvironment *ecs.Map[TileEnvironment]
157 : HeatSource *ecs.Map[HeatSource]
158 : Burning *ecs.Map[Burning]
159 : StageBound *ecs.Map[StageBound]
160 : StageField *ecs.Map[StageField]
161 : SeamlessBand *ecs.Map[SeamlessBand]
162 : PortalConnection *ecs.Map[PortalConnection]
163 : DungeonEntrance *ecs.Map[DungeonEntrance]
164 : Suspended *ecs.Map[Suspended]
165 : Player *ecs.Map[Player]
166 : Profession *ecs.Map[Profession]
167 : Hunger *ecs.Map[Hunger]
168 : Fatigue *ecs.Map[Fatigue]
169 : Sleeping *ecs.Map[Sleeping]
170 : Bedding *ecs.Map[Bedding]
171 : Wallet *ecs.Map[Wallet]
172 : FactionAlly *ecs.Map[FactionAlly]
173 : FactionEnemy *ecs.Map[FactionEnemy]
174 : FactionNeutral *ecs.Map[FactionNeutral]
175 : Dialog *ecs.Map[Dialog]
176 : Dead *ecs.Map[Dead]
177 : TurnBased *ecs.Map[TurnBased]
178 : HealthStatus *ecs.Map[HealthStatus]
179 : Skills *ecs.Map[Skills]
180 : StateChangeRequest *ecs.Map[StateChangeRequest]
181 : StatsChanged *ecs.Map[StatsChanged]
182 : WeightDirty *ecs.Map[WeightDirty]
183 : ProvidesHealing *ecs.Map[ProvidesHealing]
184 : ProvidesNutrition *ecs.Map[ProvidesNutrition]
185 : InflictsDamage *ecs.Map[InflictsDamage]
186 : Remedy *ecs.Map[Remedy]
187 : Book *ecs.Map[Book]
188 : CommandTable *ecs.Map[CommandTable]
189 : DropTable *ecs.Map[DropTable]
190 : Activity *ecs.Map[Activity]
191 : LastActivity *ecs.Map[LastActivity]
192 : GameLog *ecs.Map[GameLog]
193 : Dungeon *ecs.Map[Dungeon]
194 : TurnState *ecs.Map[TurnState]
195 : SpatialIndex *ecs.Map[SpatialIndex]
196 : WeaponSelection *ecs.Map[WeaponSelection]
197 : GameTime *ecs.Map[GameTime]
198 : Weather *ecs.Map[Weather]
199 : PlayTime *ecs.Map[PlayTime]
200 : VisionState *ecs.Map[VisionState]
201 : UserSettings *ecs.Map[UserSettings]
202 : RunStats *ecs.Map[RunStats]
203 : }
204 :
205 : // InitializeComponents registers every component type with the Ark world
206 : // and assigns a typed Map handle to each field.
207 : func (c *Components) InitializeComponents(world *ecs.World) error {
208 1 : c.Name = ecs.NewMap[Name](world)
209 1 : c.RawID = ecs.NewMap[RawID](world)
210 1 : c.Description = ecs.NewMap[Description](world)
211 1 : c.HP = ecs.NewMap[HP](world)
212 1 : c.Consumable = ecs.NewMap[Consumable](world)
213 1 : c.Material = ecs.NewMap[Material](world)
214 1 : c.FireStarter = ecs.NewMap[FireStarter](world)
215 1 : c.EscapeDevice = ecs.NewMap[EscapeDevice](world)
216 1 : c.CubeCore = ecs.NewMap[CubeCore](world)
217 1 : c.Perishable = ecs.NewMap[Perishable](world)
218 1 : c.WeightCapacity = ecs.NewMap[WeightCapacity](world)
219 1 : c.Melee = ecs.NewMap[Melee](world)
220 1 : c.Fire = ecs.NewMap[Fire](world)
221 1 : c.Value = ecs.NewMap[Value](world)
222 1 : c.Weight = ecs.NewMap[Weight](world)
223 1 : c.Recipe = ecs.NewMap[Recipe](world)
224 1 : c.Wearable = ecs.NewMap[Wearable](world)
225 1 : c.Abilities = ecs.NewMap[Abilities](world)
226 1 : c.Ammo = ecs.NewMap[Ammo](world)
227 1 : c.CubeModule = ecs.NewMap[CubeModule](world)
228 1 : c.Deployable = ecs.NewMap[Deployable](world)
229 1 : c.LocationInBackpack = ecs.NewMap[LocationInBackpack](world)
230 1 : c.LocationEquipped = ecs.NewMap[LocationEquipped](world)
231 1 : c.LocationOnField = ecs.NewMap[LocationOnField](world)
232 1 : c.LocationInStorage = ecs.NewMap[LocationInStorage](world)
233 1 : c.LocationStowed = ecs.NewMap[LocationStowed](world)
234 1 : c.LocationInstalled = ecs.NewMap[LocationInstalled](world)
235 1 : c.Tile = ecs.NewMap[Tile](world)
236 1 : c.SoloAI = ecs.NewMap[SoloAI](world)
237 1 : c.Camera = ecs.NewMap[Camera](world)
238 1 : c.Position = ecs.NewMap[Position](world)
239 1 : c.GridElement = ecs.NewMap[GridElement](world)
240 1 : c.SpriteRender = ecs.NewMap[SpriteRender](world)
241 1 : c.BlockView = ecs.NewMap[BlockView](world)
242 1 : c.BlockPass = ecs.NewMap[BlockPass](world)
243 1 : c.PassCost = ecs.NewMap[PassCost](world)
244 1 : c.Door = ecs.NewMap[Door](world)
245 1 : c.Pose = ecs.NewMap[Pose](world)
246 1 : c.Item = ecs.NewMap[Item](world)
247 1 : c.Prop = ecs.NewMap[Prop](world)
248 1 : c.Cube = ecs.NewMap[Cube](world)
249 1 : c.FuelTank = ecs.NewMap[FuelTank](world)
250 1 : c.Deployed = ecs.NewMap[Deployed](world)
251 1 : c.LightSource = ecs.NewMap[LightSource](world)
252 1 : c.Interactable = ecs.NewMap[Interactable](world)
253 1 : c.Unsearched = ecs.NewMap[Unsearched](world)
254 1 : c.VisualEffects = ecs.NewMap[VisualEffects](world)
255 1 : c.TileEnvironment = ecs.NewMap[TileEnvironment](world)
256 1 : c.HeatSource = ecs.NewMap[HeatSource](world)
257 1 : c.Burning = ecs.NewMap[Burning](world)
258 1 : c.StageBound = ecs.NewMap[StageBound](world)
259 1 : c.StageField = ecs.NewMap[StageField](world)
260 1 : c.SeamlessBand = ecs.NewMap[SeamlessBand](world)
261 1 : c.PortalConnection = ecs.NewMap[PortalConnection](world)
262 1 : c.DungeonEntrance = ecs.NewMap[DungeonEntrance](world)
263 1 : c.Suspended = ecs.NewMap[Suspended](world)
264 1 : c.Player = ecs.NewMap[Player](world)
265 1 : c.Profession = ecs.NewMap[Profession](world)
266 1 : c.Hunger = ecs.NewMap[Hunger](world)
267 1 : c.Fatigue = ecs.NewMap[Fatigue](world)
268 1 : c.Sleeping = ecs.NewMap[Sleeping](world)
269 1 : c.Bedding = ecs.NewMap[Bedding](world)
270 1 : c.Wallet = ecs.NewMap[Wallet](world)
271 1 : c.FactionAlly = ecs.NewMap[FactionAlly](world)
272 1 : c.FactionEnemy = ecs.NewMap[FactionEnemy](world)
273 1 : c.FactionNeutral = ecs.NewMap[FactionNeutral](world)
274 1 : c.Dialog = ecs.NewMap[Dialog](world)
275 1 : c.Dead = ecs.NewMap[Dead](world)
276 1 : c.TurnBased = ecs.NewMap[TurnBased](world)
277 1 : c.HealthStatus = ecs.NewMap[HealthStatus](world)
278 1 : c.Skills = ecs.NewMap[Skills](world)
279 1 : c.StateChangeRequest = ecs.NewMap[StateChangeRequest](world)
280 1 : c.StatsChanged = ecs.NewMap[StatsChanged](world)
281 1 : c.WeightDirty = ecs.NewMap[WeightDirty](world)
282 1 : c.ProvidesHealing = ecs.NewMap[ProvidesHealing](world)
283 1 : c.ProvidesNutrition = ecs.NewMap[ProvidesNutrition](world)
284 1 : c.InflictsDamage = ecs.NewMap[InflictsDamage](world)
285 1 : c.Remedy = ecs.NewMap[Remedy](world)
286 1 : c.Book = ecs.NewMap[Book](world)
287 1 : c.CommandTable = ecs.NewMap[CommandTable](world)
288 1 : c.DropTable = ecs.NewMap[DropTable](world)
289 1 : c.Activity = ecs.NewMap[Activity](world)
290 1 : c.LastActivity = ecs.NewMap[LastActivity](world)
291 1 : c.GameLog = ecs.NewMap[GameLog](world)
292 1 : c.Dungeon = ecs.NewMap[Dungeon](world)
293 1 : c.TurnState = ecs.NewMap[TurnState](world)
294 1 : c.SpatialIndex = ecs.NewMap[SpatialIndex](world)
295 1 : c.WeaponSelection = ecs.NewMap[WeaponSelection](world)
296 1 : c.GameTime = ecs.NewMap[GameTime](world)
297 1 : c.Weather = ecs.NewMap[Weather](world)
298 1 : c.PlayTime = ecs.NewMap[PlayTime](world)
299 1 : c.VisionState = ecs.NewMap[VisionState](world)
300 1 : c.UserSettings = ecs.NewMap[UserSettings](world)
301 1 : c.RunStats = ecs.NewMap[RunStats](world)
302 1 : return nil
303 1 : }
304 :
305 : // AddEntity creates a new entity from an EntitySpec and attaches each non-nil field
306 : // as its corresponding component.
307 : func (c *Components) AddEntity(world *ecs.World, spec *EntitySpec) ecs.Entity {
308 1 : entity := world.NewEntity()
309 1 : addComp(c.Name, entity, spec.Name)
310 1 : addComp(c.RawID, entity, spec.RawID)
311 1 : addComp(c.Description, entity, spec.Description)
312 1 : addComp(c.HP, entity, spec.HP)
313 1 : addComp(c.Consumable, entity, spec.Consumable)
314 1 : addComp(c.Material, entity, spec.Material)
315 1 : addComp(c.FireStarter, entity, spec.FireStarter)
316 1 : addComp(c.EscapeDevice, entity, spec.EscapeDevice)
317 1 : addComp(c.CubeCore, entity, spec.CubeCore)
318 1 : addComp(c.Perishable, entity, spec.Perishable)
319 1 : addComp(c.WeightCapacity, entity, spec.WeightCapacity)
320 1 : addComp(c.Melee, entity, spec.Melee)
321 1 : addComp(c.Fire, entity, spec.Fire)
322 1 : addComp(c.Value, entity, spec.Value)
323 1 : addComp(c.Weight, entity, spec.Weight)
324 1 : addComp(c.Recipe, entity, spec.Recipe)
325 1 : addComp(c.Wearable, entity, spec.Wearable)
326 1 : addComp(c.Abilities, entity, spec.Abilities)
327 1 : addComp(c.Ammo, entity, spec.Ammo)
328 1 : addComp(c.CubeModule, entity, spec.CubeModule)
329 1 : addComp(c.Deployable, entity, spec.Deployable)
330 1 : addComp(c.LocationInBackpack, entity, spec.LocationInBackpack)
331 1 : addComp(c.LocationEquipped, entity, spec.LocationEquipped)
332 1 : addComp(c.LocationOnField, entity, spec.LocationOnField)
333 1 : addComp(c.LocationInStorage, entity, spec.LocationInStorage)
334 1 : addComp(c.LocationStowed, entity, spec.LocationStowed)
335 1 : addComp(c.LocationInstalled, entity, spec.LocationInstalled)
336 1 : addComp(c.Tile, entity, spec.Tile)
337 1 : addComp(c.SoloAI, entity, spec.SoloAI)
338 1 : addComp(c.Camera, entity, spec.Camera)
339 1 : addComp(c.Position, entity, spec.Position)
340 1 : addComp(c.GridElement, entity, spec.GridElement)
341 1 : addComp(c.SpriteRender, entity, spec.SpriteRender)
342 1 : addComp(c.BlockView, entity, spec.BlockView)
343 1 : addComp(c.BlockPass, entity, spec.BlockPass)
344 1 : addComp(c.PassCost, entity, spec.PassCost)
345 1 : addComp(c.Door, entity, spec.Door)
346 1 : addComp(c.Pose, entity, spec.Pose)
347 1 : addComp(c.Item, entity, spec.Item)
348 1 : addComp(c.Prop, entity, spec.Prop)
349 1 : addComp(c.Cube, entity, spec.Cube)
350 1 : addComp(c.FuelTank, entity, spec.FuelTank)
351 1 : addComp(c.Deployed, entity, spec.Deployed)
352 1 : addComp(c.LightSource, entity, spec.LightSource)
353 1 : addComp(c.Interactable, entity, spec.Interactable)
354 1 : addComp(c.Unsearched, entity, spec.Unsearched)
355 1 : addComp(c.VisualEffects, entity, spec.VisualEffects)
356 1 : addComp(c.TileEnvironment, entity, spec.TileEnvironment)
357 1 : addComp(c.HeatSource, entity, spec.HeatSource)
358 1 : addComp(c.Burning, entity, spec.Burning)
359 1 : addComp(c.StageBound, entity, spec.StageBound)
360 1 : addComp(c.StageField, entity, spec.StageField)
361 1 : addComp(c.SeamlessBand, entity, spec.SeamlessBand)
362 1 : addComp(c.PortalConnection, entity, spec.PortalConnection)
363 1 : addComp(c.DungeonEntrance, entity, spec.DungeonEntrance)
364 1 : addComp(c.Suspended, entity, spec.Suspended)
365 1 : addComp(c.Player, entity, spec.Player)
366 1 : addComp(c.Profession, entity, spec.Profession)
367 1 : addComp(c.Hunger, entity, spec.Hunger)
368 1 : addComp(c.Fatigue, entity, spec.Fatigue)
369 1 : addComp(c.Sleeping, entity, spec.Sleeping)
370 1 : addComp(c.Bedding, entity, spec.Bedding)
371 1 : addComp(c.Wallet, entity, spec.Wallet)
372 1 : addComp(c.FactionAlly, entity, spec.FactionAlly)
373 1 : addComp(c.FactionEnemy, entity, spec.FactionEnemy)
374 1 : addComp(c.FactionNeutral, entity, spec.FactionNeutral)
375 1 : addComp(c.Dialog, entity, spec.Dialog)
376 1 : addComp(c.Dead, entity, spec.Dead)
377 1 : addComp(c.TurnBased, entity, spec.TurnBased)
378 1 : addComp(c.HealthStatus, entity, spec.HealthStatus)
379 1 : addComp(c.Skills, entity, spec.Skills)
380 1 : addComp(c.StateChangeRequest, entity, spec.StateChangeRequest)
381 1 : addComp(c.StatsChanged, entity, spec.StatsChanged)
382 1 : addComp(c.WeightDirty, entity, spec.WeightDirty)
383 1 : addComp(c.ProvidesHealing, entity, spec.ProvidesHealing)
384 1 : addComp(c.ProvidesNutrition, entity, spec.ProvidesNutrition)
385 1 : addComp(c.InflictsDamage, entity, spec.InflictsDamage)
386 1 : addComp(c.Remedy, entity, spec.Remedy)
387 1 : addComp(c.Book, entity, spec.Book)
388 1 : addComp(c.CommandTable, entity, spec.CommandTable)
389 1 : addComp(c.DropTable, entity, spec.DropTable)
390 1 : addComp(c.Activity, entity, spec.Activity)
391 1 : addComp(c.LastActivity, entity, spec.LastActivity)
392 1 : addComp(c.GameLog, entity, spec.GameLog)
393 1 : addComp(c.Dungeon, entity, spec.Dungeon)
394 1 : addComp(c.TurnState, entity, spec.TurnState)
395 1 : addComp(c.SpatialIndex, entity, spec.SpatialIndex)
396 1 : addComp(c.WeaponSelection, entity, spec.WeaponSelection)
397 1 : addComp(c.GameTime, entity, spec.GameTime)
398 1 : addComp(c.Weather, entity, spec.Weather)
399 1 : addComp(c.PlayTime, entity, spec.PlayTime)
400 1 : addComp(c.VisionState, entity, spec.VisionState)
401 1 : addComp(c.UserSettings, entity, spec.UserSettings)
402 1 : addComp(c.RunStats, entity, spec.RunStats)
403 1 : return entity
404 1 : }
|