pub enum Type {
Show 104 variants
Int,
Boolean,
String,
Long,
Char,
Colour,
Coord,
Loc,
Npc,
Obj,
NamedObj,
PlayerUid,
NpcUid,
Seq,
Spotanim,
Synth,
Vorbis,
Midi,
Jingle,
Graphic,
FontMetrics,
ChatCat,
ChatPhrase,
Model,
Texture,
IdKit,
MesAnim,
Hitmark,
Stat,
Component,
IfType,
SetPosH,
SetPosV,
SetSize,
SetTextAlignH,
SetTextAlignV,
ClanForumQfc,
IntArray,
Key,
ChatType,
ChatFilter,
WindowMode,
PlatformType,
IntBool,
Interface,
TopLevelInterface,
OverlayInterface,
Inv,
Enum,
Struct,
Param,
DbTable,
DbRow,
DbColumn,
Category,
Varp,
Varn,
Vars,
VarpBit,
Varc,
VarClan,
VarClanSetting,
VarCon,
VarConBit,
VarnBit,
VarObj,
MapZone,
MapArea,
MapElement,
LocShape,
NpcMode,
NpcStat,
Area,
Hunt,
MoveSpeed,
EntityOverlay,
StringVector,
WriteInv,
Bas,
Billboard,
ParticleEffector,
ParticleEmitter,
Cursor,
Flo,
Flu,
ItemCode,
Light,
Msi,
Quest,
Controller,
RegionCoord,
RegionUid,
Proc,
ClientScript,
Label,
Queue,
SoftTimer,
Timer,
Walktrigger,
ControllerQueue,
NpcQueue,
Any,
Error,
Void,
}Expand description
All script variable types supported by RuneScript. These correspond to the types used in the 2004Scape/RS2 engine.
Variants§
Int
Boolean
String
Long
Char
Colour
Coord
Loc
Npc
Obj
NamedObj
PlayerUid
NpcUid
Seq
Spotanim
Synth
Vorbis
Midi
Jingle
Graphic
FontMetrics
ChatCat
ChatPhrase
Model
Texture
IdKit
MesAnim
Hitmark
Stat
Component
IfType
SetPosH
SetPosV
SetSize
SetTextAlignH
SetTextAlignV
ClanForumQfc
IntArray
A parameter holding the number of one of the caller’s arrays.
Key
ChatType
ChatFilter
WindowMode
PlatformType
IntBool
Interface
TopLevelInterface
OverlayInterface
Inv
Enum
Struct
Param
DbTable
DbRow
DbColumn
Category
Varp
Varn
Vars
VarpBit
Varc
VarClan
VarClanSetting
VarCon
VarConBit
VarnBit
VarObj
MapZone
MapArea
MapElement
LocShape
NpcMode
NpcStat
Area
Hunt
MoveSpeed
EntityOverlay
StringVector
WriteInv
Bas
Billboard
ParticleEffector
ParticleEmitter
Cursor
Flo
Flu
ItemCode
Light
Msi
Quest
Controller
RegionCoord
RegionUid
A region (instance), as region_uid gives it and
region_findbyuid takes it.
Proc
ClientScript
Label
Queue
SoftTimer
Timer
Walktrigger
ControllerQueue
NpcQueue
Any
Error
Void
Implementations§
Source§impl Type
impl Type
Sourcepub const CHARS: &'static str = "is§1clnoOpNAtPMjdmxKSIavgJyVÐþ`µzf«ke@\u{80}"
pub const CHARS: &'static str = "is§1clnoOpNAtPMjdmxKSIavgJyVÐþ`µzf«ke@\u{80}"
Every character a script names a type by.
pub fn to_char(self) -> char
pub fn from_char(ch: char) -> Option<Self>
Sourcepub fn base_type(&self) -> BaseVarType
pub fn base_type(&self) -> BaseVarType
Returns the base var type (determines which stack to use).
Sourcepub fn default_int_value(&self) -> i32
pub fn default_int_value(&self) -> i32
Default value for uninitialised local variable declarations. Boolean and Int default to 0; all other int-based types default to -1 (null).
Sourcepub fn default_return_value(&self) -> i32
pub fn default_return_value(&self) -> i32
Default value for implicit return values at end of scripts. Only Int pushes 0; everything else (including Boolean) pushes -1.
Sourcepub fn from_def_str(s: &str) -> Option<Type>
pub fn from_def_str(s: &str) -> Option<Type>
Parse a type name from a def_ prefix (e.g., “def_int” -> Int).
Sourcepub fn from_name(s: &str) -> Option<Type>
pub fn from_name(s: &str) -> Option<Type>
Parse a type from its bare name (e.g., “int” -> Int).
Sourcepub fn is_int_kind(&self) -> bool
pub fn is_int_kind(&self) -> bool
An int that only differs in how its values print: declarations say int.
Sourcepub fn declared_name(&self) -> &'static str
pub fn declared_name(&self) -> &'static str
The name a declaration of this type gives.
pub fn allow_switch(&self) -> bool
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Returns true if this is a numeric type that supports arithmetic.
Sourcepub fn is_obj_type(&self) -> bool
pub fn is_obj_type(&self) -> bool
Returns true if this is a type that uses object-style comparison (string equality).
Sourcepub fn all_def_keywords() -> Vec<&'static str>
pub fn all_def_keywords() -> Vec<&'static str>
Returns all known def_ type names.