Hi hive!.
I created this thread because need help to create a system to save hero unit with his spells.
I want to access to data like this =>
Hero[0] = Arthas
Hero[0]_spells[0] = Heal
Hero[0]_spells[1] = Armor
Hero[0]_spells[2] = DamageX2
Hero[1] = Madthas
Hero[1]_spells[0] = Damage
Hero[1]_spells[1] = Huge Damage
Hero[1]_spells[2] = Suicide
But dont want use a lot of arrays
I triyed this form either
Hero[id] = Hero
Spells[(hero_id*MaximumNumberOfSpells+1)+spell_index] = Spell(s)
Result
Hero[0] = Arthas
Spells[(0*5)+0] = Heal --> 0
Spells[(0*5)+1] = DamageX2 --> 1
Spells[(0*5)+2] = DamageMaster --> 2
Spells[(0*5)+3] = Anotehr --> 3
Spells[(0*5)+4] = Another --> 4
Hero[1] = Mad
Spells[(1*5)+0] = Heal --> 5
Spells[(2*5)+1] = DamageX2 --> 11
Spells[(3*5)+2] = DamageMaster --> 17
Spells[(4*5)+3] = Anotehr --> 23
Spells[(5*5)+4] = Another --> 29
Is there a more efficient way to save hero and his spells?
I created this thread because need help to create a system to save hero unit with his spells.
I want to access to data like this =>
Hero[0] = Arthas
Hero[0]_spells[0] = Heal
Hero[0]_spells[1] = Armor
Hero[0]_spells[2] = DamageX2
Hero[1] = Madthas
Hero[1]_spells[0] = Damage
Hero[1]_spells[1] = Huge Damage
Hero[1]_spells[2] = Suicide
But dont want use a lot of arrays
I triyed this form either
Hero[id] = Hero
Spells[(hero_id*MaximumNumberOfSpells+1)+spell_index] = Spell(s)
Result
Hero[0] = Arthas
Spells[(0*5)+0] = Heal --> 0
Spells[(0*5)+1] = DamageX2 --> 1
Spells[(0*5)+2] = DamageMaster --> 2
Spells[(0*5)+3] = Anotehr --> 3
Spells[(0*5)+4] = Another --> 4
Hero[1] = Mad
Spells[(1*5)+0] = Heal --> 5
Spells[(2*5)+1] = DamageX2 --> 11
Spells[(3*5)+2] = DamageMaster --> 17
Spells[(4*5)+3] = Anotehr --> 23
Spells[(5*5)+4] = Another --> 29
Is there a more efficient way to save hero and his spells?