Skip to content

Instantly share code, notes, and snippets.

@thistleknot
Last active December 21, 2015 00:09
Show Gist options
  • Save thistleknot/6217867 to your computer and use it in GitHub Desktop.
Save thistleknot/6217867 to your computer and use it in GitHub Desktop.
TraitArrayBins = {}
TraitArrayBins.__index = TraitArrayBins
function TraitArrayBins.create(name, traitMin, traitMed, traitMax)
local trait = {}
setmetatable(trait,TraitArrayBins)
trait.name = name
trait.traitMin = traitMin
trait.traitMed = traitMed
trait.traitMax = traitMax
return trait
end
function TraitArrayBins:get()
print("Name: ", self.name, self.traitMin, self.traitMed, self.traitMax)
end
-- create and use an Account
tempTrait = TraitArrayBins.create("Willpower", 0, 50, 100)
tempTrait:get()
t_Holder = {}
for int = 1, 30 do
t_Holder[int] = TraitArrayBins.create("Willpower", 0+int, 50, 100-int)
end
for int = 1, 30 do
t_Holder[int]:get()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment