- Joined
- Jul 10, 2007
- Messages
- 6,306
See Damage Text for a good demonstration.
Demonstration
JASS:
library DamageType /* v1.0.0.0
*************************************************************************************
*
* Creates custom damage types of priorities. Priority determines in what order to
* display the damage in a of different damage types.
*
************************************************************************************
*
* struct DamageType extends array
*
* readonly string color
* readonly integer invPriority
* - inverse priority means that the lower priorities run first
*
* static method create takes string color, integer priority returns thistype
*
************************************************************************************/
struct DamageType extends array
private static integer instanceCount = 0
readonly string color
readonly integer invPriority
static method create takes string color, integer invPriority returns thistype
local thistype this = instanceCount + 1
set instanceCount = this
set this.color = color
set this.invPriority = invPriority
return this
endmethod
endstruct
endlibrary
Demonstration
JASS:
library DamageTypes uses DamageType
private module DamageTypes_mod
readonly static DamageType NULL = 0
readonly static DamageType PHYSICAL
private static method onInit takes nothing returns nothing
/* Color Inv Priority */
set PHYSICAL = DamageType.create("ffffff", 0)
endmethod
endmodule
struct DamageTypes extends array
implement DamageTypes_mod
endstruct
endlibrary
Last edited: