Game Development Community

About datablock

by Wangxu · in Torque Game Engine · 10/25/2004 (4:50 pm) · 3 replies

I'm new here.I want to know what's the difference between these :

datablock ItemData(Ammo){
}

function Ammo(...){}
function ItemData(...){}

.

#1
10/25/2004 (5:22 pm)
A datablock is basically a bunch of static information that is eventually attached to an object which then make up that objects properties.

ItemData:: functions are script functions of that datablock. Most if not all of these are called from within the C++ source.

Ammo is a namespace of the ItemData.
#2
10/25/2004 (5:29 pm)
Then what's the difference between function
function Ammo::onAdd() and

function ItemData::onAdd() ?
#3
10/25/2004 (5:34 pm)
ItemData::onAdd would apply to any ItemData object

The Ammo::OnAdd is used to have a specialize onAdd for Ammo objects only, which would prevent the Item::onAdd from being called