Mutliple delegate features have been added to reduce the tediousness and bugs caused by rewriting code many times, and as a by-product make the code look a lot more tidy while keeping readability (depending of course on how you name stuff)
Added the functionality to use an AttributeKey<T> as a delegate for a Pawn extension property returning T. Example: var Player.protectItem by PROTECT_ITEM_ATTR
-- You can operator invoke the AttributeKey<T> with a T value to return an AttributeDelegate<T> with a default value that you passed. Example: var Player.protectItem by PROTECT_ITEM_ATTR(false)
Added the functionality to set a Varp as a T delegate for a Player extension property returning T.
-- IntVarp is included as a sample implementation of VarpDelegate. Example: var Player.questPoints by IntVarp(101)
Added the functionality to set a Varbit as a T delegate for a Player extension property returning T.
-- IntVarbit is included as a sample implementation of VarbitDelegate. Example: var Player.slayerPoints by IntVarbit(4068)
-- BoolVarbit is included as a sample implementation of VarbitDelegate. Example: var Player.gargoyleSlayer by BoolVarbit(4027)
[576657d]
Fixed VarbitDelegate.getVarbit using varbitId rather than varbitDef.varp resulting in either the wrong value being gotten or an exception being thrown.
What has been done?
AttributeKey<T>
as a delegate for aPawn
extension property returningT
. Example:var Player.protectItem by PROTECT_ITEM_ATTR
-- You can operator invoke theAttributeKey<T>
with aT
value to return anAttributeDelegate<T>
with a default value that you passed. Example:var Player.protectItem by PROTECT_ITEM_ATTR(false)
T
delegate for aPlayer
extension property returningT
. --IntVarp
is included as a sample implementation ofVarpDelegate
. Example:var Player.questPoints by IntVarp(101)
T
delegate for aPlayer
extension property returningT
. --IntVarbit
is included as a sample implementation ofVarbitDelegate
. Example:var Player.slayerPoints by IntVarbit(4068)
--BoolVarbit
is included as a sample implementation ofVarbitDelegate
. Example:var Player.gargoyleSlayer by BoolVarbit(4027)