Skip to content

Commit

Permalink
Remove brackets when invoking access templates
Browse files Browse the repository at this point in the history
  • Loading branch information
rlipsc committed Sep 28, 2022
1 parent 58c4c56 commit cab5a11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/polymorph/runtimeconstruction.nim
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ proc makeRuntimeConstruction*(id: EcsIdentity): NimNode =
1.ComponentGeneration

`reference` = (
componentId(),
componentId,
owningSystem.count.ComponentIndex,
nextGen
)
Expand All @@ -419,7 +419,7 @@ proc makeRuntimeConstruction*(id: EcsIdentity): NimNode =
1.ComponentGeneration

`reference` = (
componentId(),
componentId,
owningSystem.count.ComponentIndex,
nextGen
)
Expand Down Expand Up @@ -543,7 +543,7 @@ proc makeRuntimeConstruction*(id: EcsIdentity): NimNode =
#`reference` = compRef

`reference` = (
componentId(),
componentId,
owningSystem.count.ComponentIndex,
1.ComponentGeneration # TODO: Update generation.
)
Expand Down
8 changes: 4 additions & 4 deletions src/polymorph/sealing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ proc makeRuntimeStrOutput(id: EcsIdentity): NimNode =
proc `strOp`*(componentId: ComponentTypeId): string =
## Display the name and id for a component type.
componentId.caseComponent:
`res` = `compName`() & " (" & `strOp`(int(componentId)) & ")"
`res` = `compName` & " (" & `strOp`(int(componentId)) & ")"

proc `strOp`*(componentIds: seq[ComponentTypeId]): string =
## Display the name and id for a list of component types.
Expand All @@ -575,13 +575,13 @@ proc makeRuntimeStrOutput(id: EcsIdentity): NimNode =

func typeName*(componentId: ComponentTypeId): string =
componentId.caseComponent:
`res` = `compName`()
`res` = `compName`

proc toString*(componentRef: ComponentRef, `showData`: bool = `showDataDefault`): string =
## Display the name, type and data for a component reference.
let tId = componentRef.typeId
tId.caseComponent:
`res` = `compName`() & " (id: " & `strOp`(int(tId)) & ", index: " & `strOp`(componentRef.index.int) & ", generation: " & `strOp`(componentRef.generation.int) & ")"
`res` = `compName` & " (id: " & `strOp`(int(tId)) & ", index: " & `strOp`(componentRef.index.int) & ", generation: " & `strOp`(componentRef.generation.int) & ")"
if `showData`:
`res` &= ":\n"
try:
Expand All @@ -596,7 +596,7 @@ proc makeRuntimeStrOutput(id: EcsIdentity): NimNode =
## `$` function for dynamic component superclass.
## Displays the sub-class data according to the component's `typeId`.
caseComponent comp.typeId:
`res` &= `compName`()
`res` &= `compName`
if `showData`:
`res` &= ":\n" & $componentRefType()(comp).value & "\n"

Expand Down

0 comments on commit cab5a11

Please sign in to comment.