Login
Register
Menu
Home
Forum
JassDoc
Types
Functions
Variables
Help
Chat
Media
Search
Search posts
WC3 JASS.com
"The Jass Vault" plus vJASS and Zinc
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
TableField
Warcraft III:
Maps
Models
Skins
Icons
Spells / Systems
Tools
Tutorials
Snippets
JASS vJASS Spells and Systems
Tutorials
Chat @Discord
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation
-
Zinc documentation
-
WC3 Optimizer documentation
TableField
Codes & Snippets
Started by
moyack
Views
1409
Replies
0
Users
1
1
Pages:
1
Go Down
0 Members and 1 Guest are viewing this topic.
nestharus
Newbie - level 2
Posts:
23
WC3 Models: 0
WC3 Tutorials: 0
WC3 Tools: 0
WC3 Maps: 0
WC3 Skins: 0
WC3 Icons: 0
WC3 Spells: 0
Reputation:
20
User
TableField
on:
February 22, 2012, 11:42:49 PM
Category:
Variables
Language:
vJASS
Related Topics or Resources
[Snippet] New Table
by
Bribe
Init
by
nestharus
Code: jass
library
TableField
/* v1.0.0.1
************************************************************************************
*
* */
uses
/*
*
* */
Table
/*
* */
Init
/*
*
************************************************************************************
*
* //! textmacro CREATE_TABLE_FIELD takes ACCESS_MODIFIER, TYPE, NAME, RETURN_TYPE
* - creates a table field surrounded by method operators
*
* //! textmacro INITIALIZE_TABLE_FIELD takes NAME
* - initializes table field
* - used in onInit
*
* //! textmacro CREATE_TABLE_FIELD_ARRAY takes TYPE, NAME, RETURN_TYPE
* - creates a struct that acts as an array
* - not used in a struct
*
* //! textmacro USE_TABLE_FIELD_ARRAY takes ACCESS_MODIFIER, NAME
* - creates a field of a struct array
* - used in a struct
*
************************************************************************************/
//! textmacro CREATE_TABLE_FIELD takes ACCESS_MODIFIER, TYPE, NAME, RETURN_TYPE
private
static
Table t$NAME$
$AC
CESS_MODIFIER$
method
operator
$NAME$
takes
nothing
returns
$RETURN_TYPE$
return
t$NAME$.$TYPE$[
this
]
endmethod
$AC
CESS_MODIFIER$
method
operator
$NAME$=
takes
$RETURN_TYPE$ value
returns
nothing
set
t$NAME$.$TYPE$[
this
] = value
endmethod
$AC
CESS_MODIFIER$
method
$NAME$_clear
takes
nothing
returns
nothing
call
t$NAME$.$TYPE$.remove(
this
)
endmethod
//! endtextmacro
//! textmacro CREATE_TABLE_FIELD_ARRAY takes TYPE, NAME, RETURN_TYPE
private
struct
T$NAME$
extends
array
private
static
Table table
method
operator
[]
takes
integer
index
returns
$RETURN_TYPE$
return
table.$TYPE$[index]
endmethod
method
operator
[]=
takes
integer
index, $RETURN_TYPE$ value
returns
nothing
set
table.$TYPE$[index] = value
endmethod
static
method
remove
takes
integer
index
returns
nothing
call
table.$TYPE$.remove(index)
endmethod
static
method
clear
takes
nothing
returns
nothing
call
table.flush()
endmethod
private
static
method
init
takes
nothing
returns
nothing
set
table = Table.
create
()
endmethod
implement
Init
endstruct
//! endtextmacro
//! textmacro USE_TABLE_FIELD_ARRAY takes ACCESS_MODIFIER, NAME
$AC
CESS_MODIFIER$
static
T$NAME$ $NAME$ = 0
//! endtextmacro
//! textmacro INITIALIZE_TABLE_FIELD takes NAME
set
t$NAME$ = Table.
create
()
//! endtextmacro
endlibrary
«
Last Edit: December 19, 2017, 12:56:18 AM by moyack
»
Print
Pages:
1
Go Up
« previous
next »
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
TableField
PortaMx-SEF 1.54
|
PortaMx © 2008-2015
,
PortaMx corp.
Search
Username
Password
Always stay logged in
Forgot your password?