WildStar:API GameLib CodeEnumClass: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Created page with " === Enum === == CodeEnumClass == CodeEnumClass = {       Engineer = 2,       Esper = 3,       Medic = 4,       Spellslinger = 7,       Stalker = 5,   ...")
 
(Created page with "{{../uiapi|toc=0}} Enum == Examples == CodeEnumClass = { Engineer = 2, Esper = 3, Medic = 4, Spellslinger = 7, Stalker = 5, Warrior = 1 } local eCla...")
Line 1: Line 1:
{{../uiapi|toc=0}}
Enum


=== Enum ===
== Examples ==
 
Example 1
 
CodeEnumClass = {
== CodeEnumClass ==
  Engineer = 2,
CodeEnumClass = {
  Esper = 3,
 
  Medic = 4,
      Engineer = 2,
  Spellslinger = 7,
 
  Stalker = 5,
      Esper = 3,
  Warrior = 1
 
}  
      Medic = 4,
 
      Spellslinger = 7,
 
      Stalker = 5,
 
      Warrior = 1
 
    }   
 
    Examples


Example 2
  local eClassId =  unitPlayer:GetClassId()
  local eClassId =  unitPlayer:GetClassId()
  if eClassId == GameLib.CodeEnumClass.Engineer then
  if eClassId == GameLib.CodeEnumClass.Engineer then

Revision as of 04:00, 5 July 2020

{{../uiapi|toc=0}} Enum

Examples

Example 1

CodeEnumClass = {
  Engineer = 2,
  Esper = 3,
  Medic = 4,
  Spellslinger = 7,
  Stalker = 5,
  Warrior = 1
}    

Example 2

local eClassId =  unitPlayer:GetClassId()
if eClassId == GameLib.CodeEnumClass.Engineer then
	self:OnCreateEngineer()
elseif unitPlayer:GetClassId() == GameLib.CodeEnumClass.Esper then
	self:OnCreateEsper()
elseif unitPlayer:GetClassId() == GameLib.CodeEnumClass.Spellslinger then
	self:OnCreateSlinger()
elseif unitPlayer:GetClassId() == GameLib.CodeEnumClass.Medic then
	self:OnCreateMedic()
elseif unitPlayer:GetClassId() == GameLib.CodeEnumClass.Warrior then
	self:OnCreateWarrior()
elseif unitPlayer:GetClassId() == GameLib.CodeEnumClass.Stalker then
	self:OnCreateStalker()
end