Packageverlocity.components
Classpublic final class verAchievements
InheritanceverAchievements Inheritance Component Inheritance Singleton Inheritance Object

Provides simple addition-based achievments. Achievements can be easily registered and when the player achieves them, a message on the bottom right will slide-in for a short duration. Additionally, this component comes with a GUI that displays a list of all achievements and their current progress.



Public Properties
 PropertyDefined By
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
verAchievements(sStage:Stage)
Constructor of the component.
verAchievements
  
_Destruct():void
[override] Destructor of the component.
verAchievements
 Inherited
_IsNotUpdating():Boolean
Returns if the component is not updating (paused).
Component
 Inherited
_IsValid():Boolean
Returns if this singleton is active/valid.
Singleton
 Inherited
_SetUpdating(bUpdating:Boolean):void
Pauses/resumes the component updating, if it's pausable.
Component
 Inherited
Updates the component, if possible.
Component
  
CloseGUI():void
Closes the achievement list GUI.
verAchievements
  
Get(sName:String):Array
Returns an acheivement table.
verAchievements
  
GetAll():Object
Returns all registered achievements.
verAchievements
  
GetPercent(sName:String):Number
Returns the percentage the achievement is at (val/required)
verAchievements
  
GetRequired(sName:String):int
Returns the required value of an achievement.
verAchievements
  
GetValue(sName:String):int
Returns the value of an achievement.
verAchievements
  
Increase(sName:String, iAmount:int = 1):void
Increases the value of the achievement.
verAchievements
  
IsGUIOpen():Boolean
Returns if the achievement GUI is open.
verAchievements
  
IsUnlocked(sName:String):Boolean
Returns if an achievement was unlocked.
verAchievements
  
OpenGUI():void
Opens the achievement list GUI.
verAchievements
  
Register(sName:String, sDisplayName:String, sDesc:String, iUnlocksAt:int = 1):void
Registers an achievement.
verAchievements
  
Reset(sName:String):void
Resets an achievement and its data.
verAchievements
  
Set(sName:String, iAmount:int = 1):void
Sets an achievement's value.
verAchievements
  
Unlock(sName:String):void
Unlocks an achievement.
verAchievements
Protected Methods
 MethodDefined By
  
[override] Concommands of the component.
verAchievements
 Inherited
_Update():void
Called each engine tick (verEngine), if the component updates
Component
Public Constants
 ConstantDefined By
  ACHI_DATA : int = 2
verAchievements
  ACHI_DESC : int = 1
verAchievements
  ACHI_DISPNAME : int = 0
verAchievements
  ACHI_MAX : int = 3
verAchievements
  ACHI_UNLOCKED : int = 4
verAchievements
Constructor Detail
verAchievements()Constructor
public function verAchievements(sStage:Stage)

Constructor of the component.

Parameters
sStage:Stage
Method Detail
_Concommands()method
override protected function _Concommands():void

Concommands of the component.

_Destruct()method 
override public function _Destruct():void

Destructor of the component.

CloseGUI()method 
public final function CloseGUI():void

Closes the achievement list GUI.

Get()method 
public final function Get(sName:String):Array

Returns an acheivement table.

Parameters

sName:String — The name of the acheivement.

Returns
Array
GetAll()method 
public function GetAll():Object

Returns all registered achievements.

Returns
Object
GetPercent()method 
public final function GetPercent(sName:String):Number

Returns the percentage the achievement is at (val/required)

Parameters

sName:String — The name of the achievement.

Returns
Number
GetRequired()method 
public final function GetRequired(sName:String):int

Returns the required value of an achievement.

Parameters

sName:String — The name of the achievement.

Returns
int
GetValue()method 
public final function GetValue(sName:String):int

Returns the value of an achievement.

Parameters

sName:String — The name of the acheivement.

Returns
int
Increase()method 
public final function Increase(sName:String, iAmount:int = 1):void

Increases the value of the achievement.

Parameters

sName:String — The name of the achievement.
 
iAmount:int (default = 1) — The amount to increase.

IsGUIOpen()method 
public final function IsGUIOpen():Boolean

Returns if the achievement GUI is open.

Returns
Boolean
IsUnlocked()method 
public final function IsUnlocked(sName:String):Boolean

Returns if an achievement was unlocked.

Parameters

sName:String — The name of the achievement.

Returns
Boolean
OpenGUI()method 
public final function OpenGUI():void

Opens the achievement list GUI.

Register()method 
public final function Register(sName:String, sDisplayName:String, sDesc:String, iUnlocksAt:int = 1):void

Registers an achievement.

Parameters

sName:String — The acheivement's name.
 
sDisplayName:String — The display name of the achievement.
 
sDesc:String — The description of the achievment.
 
iUnlocksAt:int (default = 1) — The value the achievement unlocks at.

Reset()method 
public final function Reset(sName:String):void

Resets an achievement and its data.

Parameters

sName:String — The achievment to reset.

Set()method 
public final function Set(sName:String, iAmount:int = 1):void

Sets an achievement's value.

Parameters

sName:String — The achievement to set.
 
iAmount:int (default = 1) — The value to set the achivement to.

Unlock()method 
public final function Unlock(sName:String):void

Unlocks an achievement.

Parameters

sName:String — The achievement to unlock.

Constant Detail
ACHI_DATAConstant
public const ACHI_DATA:int = 2

ACHI_DESCConstant 
public const ACHI_DESC:int = 1

ACHI_DISPNAMEConstant 
public const ACHI_DISPNAME:int = 0

ACHI_MAXConstant 
public const ACHI_MAX:int = 3

ACHI_UNLOCKEDConstant 
public const ACHI_UNLOCKED:int = 4