-
Notifications
You must be signed in to change notification settings - Fork 17
SpaceDamage
kartoFlane edited this page May 10, 2023
·
7 revisions
To inspect or manipulate a SpaceDamage instance, you can use memedit functions.
Signature: SpaceDamage Clone()
Copies this SpaceDamage
instance and returns a new one, that holds the exact same data.
Example:
local dmg1 = SpaceDamage(Point(0, 0), 1)
local dmg2 = dmg1:Clone()
dmg2.iDamage = 2
Board:DamageSpace(dmg1)
Board:DamageSpace(dmg2)
-- 3 damage total to Point(0, 0)
Signature: table ListFields()
Lists all fields a SpaceDamage
can hold. Useful for iterating.
Example:
local spaceDamage = SpaceDamage()
for _, k in ipairs(spaceDamage:ListFields()) do
LOG(k)
end
Signature: table ToTable()
Converts this SpaceDamage
to a table.
Example:
local spaceDamage = SpaceDamage(Point(1, 2), 3)
local table = spaceDamage:ToTable()
LOG(table.loc, table.iDamage)