void CSObject::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) { out->addInt( "Id", getId()); out->addString( "Name", getName().c_str()); out->addBool( "Dead", getDead()); out->addBool( "DebugObject", getDebugObject()); out->addVector3d( "Position", getRelativePosition()); out->addVector3d( "PositionOffset", getPositionOffset()); out->addVector3d( "Rotation", getRelativeRotation()); out->addVector3d( "RotationOffset", getRotationOffset()); out->addVector3d( "Scale", getRelativeScale()); out->addVector3d( "ScaleOffset", getScaleOffset()); out->addVector3d( "BBOffset", getBBOffset()); out->addBool( "Shadow", getShadow()); out->addString( "ActorFileName", getActorFileName().c_str()); out->addString( "TextureFileName", getTextureFileName().c_str()); }
inet::PlayerState Player::getState() { inet::PlayerState p; p.dir[0] = *(getDir()); p.dir[1] = *(getDir()+1); p.flyingdir = _state.flyingdir; p.left = getLeft(); p.depth = getDepth(); p.elevation = getElevation(); p.velocity[0] = *(getVelocity()); p.velocity[1] = *(getVelocity()+1); p.hp = getHP(); p.mana = getMana(); p.state = _state.state; p.defence = getDefence(); p.dead = getDead(); strcpy(p.attackid, _state.attackid); return p; }