2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-13 18:17:49 -04:00

Fix line endings and tabs

This commit is contained in:
Branan Purvine-Riley
2011-04-11 16:27:55 -07:00
parent d4250e19b5
commit 908aaeb6f6
2738 changed files with 702562 additions and 702562 deletions

View File

@ -1,114 +1,114 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallGame.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall game client class
//
pyClimbingWallGame::pyClimbingWallGame(): pyGameCli() {}
pyClimbingWallGame::pyClimbingWallGame(pfGameCli* client): pyGameCli(client)
{
if (client && (client->GetGameTypeId() != kGameTypeId_ClimbingWall))
gameClient = nil; // wrong type, just clear it out
}
bool pyClimbingWallGame::IsClimbingWallGame(std::wstring guid)
{
Uuid gameUuid(guid.c_str());
return gameUuid == kGameTypeId_ClimbingWall;
}
void pyClimbingWallGame::JoinCommonClimbingWallGame(pyKey& callbackKey, unsigned gameID)
{
ClimbingWall_CreateParam init;
pfGameMgr::GetInstance()->JoinCommonGame(callbackKey.getKey(), kGameTypeId_ClimbingWall, gameID, sizeof(init), &init);
}
void pyClimbingWallGame::ChangeNumBlockers(int amountToAdjust)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->ChangeNumBlockers(amountToAdjust);
}
}
void pyClimbingWallGame::Ready(unsigned readyType, unsigned teamNumber)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Ready(readyType, teamNumber);
}
}
void pyClimbingWallGame::ChangeBlocker(unsigned teamNumber, unsigned blockerNumber, bool added)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->ChangeBlocker(teamNumber, blockerNumber, added);
}
}
void pyClimbingWallGame::Reset()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Reset();
}
}
void pyClimbingWallGame::PlayerEntered(unsigned teamNumber)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->PlayerEntered(teamNumber);
}
}
void pyClimbingWallGame::FinishedGame()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->FinishedGame();
}
}
void pyClimbingWallGame::Panic()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Panic();
}
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallGame.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall game client class
//
pyClimbingWallGame::pyClimbingWallGame(): pyGameCli() {}
pyClimbingWallGame::pyClimbingWallGame(pfGameCli* client): pyGameCli(client)
{
if (client && (client->GetGameTypeId() != kGameTypeId_ClimbingWall))
gameClient = nil; // wrong type, just clear it out
}
bool pyClimbingWallGame::IsClimbingWallGame(std::wstring guid)
{
Uuid gameUuid(guid.c_str());
return gameUuid == kGameTypeId_ClimbingWall;
}
void pyClimbingWallGame::JoinCommonClimbingWallGame(pyKey& callbackKey, unsigned gameID)
{
ClimbingWall_CreateParam init;
pfGameMgr::GetInstance()->JoinCommonGame(callbackKey.getKey(), kGameTypeId_ClimbingWall, gameID, sizeof(init), &init);
}
void pyClimbingWallGame::ChangeNumBlockers(int amountToAdjust)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->ChangeNumBlockers(amountToAdjust);
}
}
void pyClimbingWallGame::Ready(unsigned readyType, unsigned teamNumber)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Ready(readyType, teamNumber);
}
}
void pyClimbingWallGame::ChangeBlocker(unsigned teamNumber, unsigned blockerNumber, bool added)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->ChangeBlocker(teamNumber, blockerNumber, added);
}
}
void pyClimbingWallGame::Reset()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Reset();
}
}
void pyClimbingWallGame::PlayerEntered(unsigned teamNumber)
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->PlayerEntered(teamNumber);
}
}
void pyClimbingWallGame::FinishedGame()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->FinishedGame();
}
}
void pyClimbingWallGame::Panic()
{
if (gameClient)
{
pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient);
climbingWall->Panic();
}
}

View File

@ -1,72 +1,72 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyClimbingWallGame_h
#define pyClimbingWallGame_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyClimbingWallGame
//
// PURPOSE: Class wrapper for the climbing wall game client
//
#include "pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCli.h"
#include "../../pyKey.h"
class pyClimbingWallGame : public pyGameCli
{
protected:
pyClimbingWallGame();
pyClimbingWallGame(pfGameCli* client);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallGame);
static PyObject* New(pfGameCli* client);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallGame object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallGame); // converts a PyObject to a pyClimbingWallGame (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static void AddPlasmaConstantsClasses(PyObject* m);
static bool IsClimbingWallGame(std::wstring guid);
static void JoinCommonClimbingWallGame(pyKey& callbackKey, unsigned gameID);
void ChangeNumBlockers(int amountToAdjust);
void Ready(unsigned readyType, unsigned teamNumber);
void ChangeBlocker(unsigned teamNumber, unsigned blockerNumber, bool added);
void Reset();
void PlayerEntered(unsigned teamNumber);
void FinishedGame();
void Panic();
};
#endif // pyClimbingWallGame_h
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyClimbingWallGame_h
#define pyClimbingWallGame_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyClimbingWallGame
//
// PURPOSE: Class wrapper for the climbing wall game client
//
#include "pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCli.h"
#include "../../pyKey.h"
class pyClimbingWallGame : public pyGameCli
{
protected:
pyClimbingWallGame();
pyClimbingWallGame(pfGameCli* client);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallGame);
static PyObject* New(pfGameCli* client);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallGame object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallGame); // converts a PyObject to a pyClimbingWallGame (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static void AddPlasmaConstantsClasses(PyObject* m);
static bool IsClimbingWallGame(std::wstring guid);
static void JoinCommonClimbingWallGame(pyKey& callbackKey, unsigned gameID);
void ChangeNumBlockers(int amountToAdjust);
void Ready(unsigned readyType, unsigned teamNumber);
void ChangeBlocker(unsigned teamNumber, unsigned blockerNumber, bool added);
void Reset();
void PlayerEntered(unsigned teamNumber);
void FinishedGame();
void Panic();
};
#endif // pyClimbingWallGame_h

View File

@ -1,196 +1,196 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallGame.h"
#include <python.h>
#include "../../pyEnum.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall game client class
//
PYTHON_CLASS_DEFINITION(ptClimbingWallGame, pyClimbingWallGame);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallGame, pyClimbingWallGame)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallGame)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallGame)
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsClimbingWallGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a ClimbingWall game")
{
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
if (PyUnicode_Check(textObj))
{
int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0';
bool retVal = pyClimbingWallGame::IsClimbingWallGame(text);
delete [] text;
PYTHON_RETURN_BOOL(retVal);
}
else if (PyString_Check(textObj))
{
// we'll allow this, just in case something goes weird
char* text = PyString_AsString(textObj);
wchar_t* wText = hsStringToWString(text);
bool retVal = pyClimbingWallGame::IsClimbingWallGame(wText);
delete [] wText;
PYTHON_RETURN_BOOL(retVal);
}
else
{
PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtJoinCommonClimbingWallGame, args, "Params: callbackKey, gameID\nJoins a common ClimbingWall game with the specified ID. If one doesn't exist, it creates it")
{
PyObject* callbackObj = NULL;
int gameID = 0;
if (!PyArg_ParseTuple(args, "Oii", &callbackObj, &gameID))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonClimbingWallGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
if (!pyKey::Check(callbackObj))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonClimbingWallGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(callbackObj);
pyClimbingWallGame::JoinCommonClimbingWallGame(*key, gameID);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, changeNumBlockers, args)
{
int amountToAdjust;
if (!PyArg_ParseTuple(args, "i", &amountToAdjust))
{
PyErr_SetString(PyExc_TypeError, "changeNumBlockers expects an integer");
PYTHON_RETURN_ERROR;
}
self->fThis->ChangeNumBlockers(amountToAdjust);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, ready, args)
{
int readyType, teamNumber;
if (!PyArg_ParseTuple(args, "ii", &readyType, &teamNumber))
{
PyErr_SetString(PyExc_TypeError, "ready expects two integers");
PYTHON_RETURN_ERROR;
}
self->fThis->Ready((unsigned)readyType, (unsigned)teamNumber);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, changeBlocker, args)
{
int teamNumber, blockerNumber;
char added;
if (!PyArg_ParseTuple(args, "iib", &teamNumber, &blockerNumber, &added))
{
PyErr_SetString(PyExc_TypeError, "changeBlocker expects two integers and a boolean");
PYTHON_RETURN_ERROR;
}
self->fThis->ChangeBlocker(teamNumber, blockerNumber, added != 0);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, reset, Reset)
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, playerEntered, args)
{
int teamNumber;
if (!PyArg_ParseTuple(args, "i", &teamNumber))
{
PyErr_SetString(PyExc_TypeError, "playerEntered expects an integer");
PYTHON_RETURN_ERROR;
}
self->fThis->PlayerEntered(teamNumber);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, finishedGame, FinishedGame)
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, panic, Panic)
PYTHON_START_METHODS_TABLE(ptClimbingWallGame)
PYTHON_METHOD(ptClimbingWallGame, changeNumBlockers, "Params: amountToAdjust\nAdjusts the number of blockers we are playing with"),
PYTHON_METHOD(ptClimbingWallGame, ready, "Params: readyType, teamNumber\nMarks the specified team as ready for the specified type (See PtClimbingWallReadyTypes)"),
PYTHON_METHOD(ptClimbingWallGame, changeBlocker, "Params: teamNumber, blockerNumber, added\nChanges the specified marker's state for the specified team"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, reset, "Attempts to reset the game's control panel"),
PYTHON_METHOD(ptClimbingWallGame, playerEntered, "Params: teamNumber\nTells the server that you are trying to play the game for the specified team"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, finishedGame, "Tells the server you reached the top of the wall"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, panic, "Tells the server you are panicking and want your blockers reset"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallGame, pyGameCli, "Game client for the ClimbingWall game");
// required functions for PyObject interoperability
PyObject* pyClimbingWallGame::New(pfGameCli* client)
{
ptClimbingWallGame *newObj = (ptClimbingWallGame*)ptClimbingWallGame_type.tp_new(&ptClimbingWallGame_type, NULL, NULL);
if (client && (client->GetGameTypeId() == kGameTypeId_ClimbingWall))
newObj->fThis->gameClient = client;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallGame, pyClimbingWallGame)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallGame, pyClimbingWallGame)
// Module and method definitions
void pyClimbingWallGame::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallGame);
PYTHON_CLASS_IMPORT_END(m);
}
void pyClimbingWallGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
{
PYTHON_GLOBAL_METHOD(methods, PtIsClimbingWallGame);
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonClimbingWallGame);
}
void pyClimbingWallGame::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtClimbingWallReadyTypes);
PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyNumBlockers, kClimbingWallReadyNumBlockers);
PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyBlockers, kClimbingWallReadyBlockers);
PYTHON_ENUM_END(m, PtClimbingWallReadyTypes);
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallGame.h"
#include <python.h>
#include "../../pyEnum.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall game client class
//
PYTHON_CLASS_DEFINITION(ptClimbingWallGame, pyClimbingWallGame);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallGame, pyClimbingWallGame)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallGame)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallGame)
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsClimbingWallGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a ClimbingWall game")
{
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
if (PyUnicode_Check(textObj))
{
int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0';
bool retVal = pyClimbingWallGame::IsClimbingWallGame(text);
delete [] text;
PYTHON_RETURN_BOOL(retVal);
}
else if (PyString_Check(textObj))
{
// we'll allow this, just in case something goes weird
char* text = PyString_AsString(textObj);
wchar_t* wText = hsStringToWString(text);
bool retVal = pyClimbingWallGame::IsClimbingWallGame(wText);
delete [] wText;
PYTHON_RETURN_BOOL(retVal);
}
else
{
PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtJoinCommonClimbingWallGame, args, "Params: callbackKey, gameID\nJoins a common ClimbingWall game with the specified ID. If one doesn't exist, it creates it")
{
PyObject* callbackObj = NULL;
int gameID = 0;
if (!PyArg_ParseTuple(args, "Oii", &callbackObj, &gameID))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonClimbingWallGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
if (!pyKey::Check(callbackObj))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonClimbingWallGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(callbackObj);
pyClimbingWallGame::JoinCommonClimbingWallGame(*key, gameID);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, changeNumBlockers, args)
{
int amountToAdjust;
if (!PyArg_ParseTuple(args, "i", &amountToAdjust))
{
PyErr_SetString(PyExc_TypeError, "changeNumBlockers expects an integer");
PYTHON_RETURN_ERROR;
}
self->fThis->ChangeNumBlockers(amountToAdjust);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, ready, args)
{
int readyType, teamNumber;
if (!PyArg_ParseTuple(args, "ii", &readyType, &teamNumber))
{
PyErr_SetString(PyExc_TypeError, "ready expects two integers");
PYTHON_RETURN_ERROR;
}
self->fThis->Ready((unsigned)readyType, (unsigned)teamNumber);
PYTHON_RETURN_NONE;
}
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, changeBlocker, args)
{
int teamNumber, blockerNumber;
char added;
if (!PyArg_ParseTuple(args, "iib", &teamNumber, &blockerNumber, &added))
{
PyErr_SetString(PyExc_TypeError, "changeBlocker expects two integers and a boolean");
PYTHON_RETURN_ERROR;
}
self->fThis->ChangeBlocker(teamNumber, blockerNumber, added != 0);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, reset, Reset)
PYTHON_METHOD_DEFINITION(ptClimbingWallGame, playerEntered, args)
{
int teamNumber;
if (!PyArg_ParseTuple(args, "i", &teamNumber))
{
PyErr_SetString(PyExc_TypeError, "playerEntered expects an integer");
PYTHON_RETURN_ERROR;
}
self->fThis->PlayerEntered(teamNumber);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, finishedGame, FinishedGame)
PYTHON_BASIC_METHOD_DEFINITION(ptClimbingWallGame, panic, Panic)
PYTHON_START_METHODS_TABLE(ptClimbingWallGame)
PYTHON_METHOD(ptClimbingWallGame, changeNumBlockers, "Params: amountToAdjust\nAdjusts the number of blockers we are playing with"),
PYTHON_METHOD(ptClimbingWallGame, ready, "Params: readyType, teamNumber\nMarks the specified team as ready for the specified type (See PtClimbingWallReadyTypes)"),
PYTHON_METHOD(ptClimbingWallGame, changeBlocker, "Params: teamNumber, blockerNumber, added\nChanges the specified marker's state for the specified team"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, reset, "Attempts to reset the game's control panel"),
PYTHON_METHOD(ptClimbingWallGame, playerEntered, "Params: teamNumber\nTells the server that you are trying to play the game for the specified team"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, finishedGame, "Tells the server you reached the top of the wall"),
PYTHON_BASIC_METHOD(ptClimbingWallGame, panic, "Tells the server you are panicking and want your blockers reset"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallGame, pyGameCli, "Game client for the ClimbingWall game");
// required functions for PyObject interoperability
PyObject* pyClimbingWallGame::New(pfGameCli* client)
{
ptClimbingWallGame *newObj = (ptClimbingWallGame*)ptClimbingWallGame_type.tp_new(&ptClimbingWallGame_type, NULL, NULL);
if (client && (client->GetGameTypeId() == kGameTypeId_ClimbingWall))
newObj->fThis->gameClient = client;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallGame, pyClimbingWallGame)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallGame, pyClimbingWallGame)
// Module and method definitions
void pyClimbingWallGame::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallGame);
PYTHON_CLASS_IMPORT_END(m);
}
void pyClimbingWallGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
{
PYTHON_GLOBAL_METHOD(methods, PtIsClimbingWallGame);
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonClimbingWallGame);
}
void pyClimbingWallGame::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtClimbingWallReadyTypes);
PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyNumBlockers, kClimbingWallReadyNumBlockers);
PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyBlockers, kClimbingWallReadyBlockers);
PYTHON_ENUM_END(m, PtClimbingWallReadyTypes);
}

View File

@ -1,308 +1,308 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallMsg.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall msg class
//
pyClimbingWallMsg::pyClimbingWallMsg(): pyGameCliMsg() {}
pyClimbingWallMsg::pyClimbingWallMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
{
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_ClimbingWall))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallMsg::GetClimbingWallMsgType() const
{
if (message)
return message->netMsg->messageId;
return -1;
}
PyObject* pyClimbingWallMsg::UpcastToFinalClimbingWallMsg() const
{
if (!message)
PYTHON_RETURN_NONE;
switch (message->netMsg->messageId)
{
case kSrv2Cli_ClimbingWall_NumBlockersChanged:
return pyClimbingWallNumBlockersChangedMsg::New(message);
case kSrv2Cli_ClimbingWall_Ready:
return pyClimbingWallReadyMsg::New(message);
case kSrv2Cli_ClimbingWall_BlockersChanged:
return pyClimbingWallBlockersChangedMsg::New(message);
case kSrv2Cli_ClimbingWall_PlayerEntered:
return pyClimbingWallPlayerEnteredMsg::New(message);
case kSrv2Cli_ClimbingWall_SuitMachineLocked:
return pyClimbingWallSuitMachineLockedMsg::New(message);
case kSrv2Cli_ClimbingWall_GameOver:
return pyClimbingWallGameOverMsg::New(message);
default:
PYTHON_RETURN_NONE;
}
}
///////////////////////////////////////////////////////////////////////////////
//
// The different messages we can receive
//
pyClimbingWallNumBlockersChangedMsg::pyClimbingWallNumBlockersChangedMsg(): pyClimbingWallMsg() {}
pyClimbingWallNumBlockersChangedMsg::pyClimbingWallNumBlockersChangedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_NumBlockersChanged))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallNumBlockersChangedMsg::NewBlockerCount() const
{
if (message)
{
const Srv2Cli_ClimbingWall_NumBlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_NumBlockersChanged*)message->netMsg;
return gmMsg->newBlockerCount;
}
return 0;
}
bool pyClimbingWallNumBlockersChangedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallReadyMsg::pyClimbingWallReadyMsg(): pyClimbingWallMsg() {}
pyClimbingWallReadyMsg::pyClimbingWallReadyMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_Ready))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallReadyMsg::ReadyType() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->readyType;
}
return 0;
}
bool pyClimbingWallReadyMsg::Team1Ready() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->team1Ready;
}
return false;
}
bool pyClimbingWallReadyMsg::Team2Ready() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->team2Ready;
}
return false;
}
bool pyClimbingWallReadyMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallBlockersChangedMsg::pyClimbingWallBlockersChangedMsg(): pyClimbingWallMsg() {}
pyClimbingWallBlockersChangedMsg::pyClimbingWallBlockersChangedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_BlockersChanged))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallBlockersChangedMsg::TeamNumber() const
{
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
return gmMsg->teamNumber;
}
return 0;
}
std::vector<int> pyClimbingWallBlockersChangedMsg::BlockersSet() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->blockersSet[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->blockersSet[i]);
}
}
return retVal;
}
bool pyClimbingWallBlockersChangedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallPlayerEnteredMsg::pyClimbingWallPlayerEnteredMsg(): pyClimbingWallMsg() {}
pyClimbingWallPlayerEnteredMsg::pyClimbingWallPlayerEnteredMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_PlayerEntered))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallSuitMachineLockedMsg::pyClimbingWallSuitMachineLockedMsg(): pyClimbingWallMsg() {}
pyClimbingWallSuitMachineLockedMsg::pyClimbingWallSuitMachineLockedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_SuitMachineLocked))
message = nil; // wrong type, just clear it out
}
bool pyClimbingWallSuitMachineLockedMsg::Team1MachineLocked() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->team1MachineLocked;
}
return true; // err on the side of caution
}
bool pyClimbingWallSuitMachineLockedMsg::Team2MachineLocked() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->team2MachineLocked;
}
return true; // err on the side of caution
}
bool pyClimbingWallSuitMachineLockedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallGameOverMsg::pyClimbingWallGameOverMsg(): pyClimbingWallMsg() {}
pyClimbingWallGameOverMsg::pyClimbingWallGameOverMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_GameOver))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallGameOverMsg::TeamWon() const
{
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
return gmMsg->teamWon;
}
return 0;
}
std::vector<int> pyClimbingWallGameOverMsg::Team1Blockers() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->team1Blockers[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->team1Blockers[i]);
}
}
return retVal;
}
std::vector<int> pyClimbingWallGameOverMsg::Team2Blockers() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->team2Blockers[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->team2Blockers[i]);
}
}
return retVal;
}
bool pyClimbingWallGameOverMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallMsg.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall msg class
//
pyClimbingWallMsg::pyClimbingWallMsg(): pyGameCliMsg() {}
pyClimbingWallMsg::pyClimbingWallMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
{
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_ClimbingWall))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallMsg::GetClimbingWallMsgType() const
{
if (message)
return message->netMsg->messageId;
return -1;
}
PyObject* pyClimbingWallMsg::UpcastToFinalClimbingWallMsg() const
{
if (!message)
PYTHON_RETURN_NONE;
switch (message->netMsg->messageId)
{
case kSrv2Cli_ClimbingWall_NumBlockersChanged:
return pyClimbingWallNumBlockersChangedMsg::New(message);
case kSrv2Cli_ClimbingWall_Ready:
return pyClimbingWallReadyMsg::New(message);
case kSrv2Cli_ClimbingWall_BlockersChanged:
return pyClimbingWallBlockersChangedMsg::New(message);
case kSrv2Cli_ClimbingWall_PlayerEntered:
return pyClimbingWallPlayerEnteredMsg::New(message);
case kSrv2Cli_ClimbingWall_SuitMachineLocked:
return pyClimbingWallSuitMachineLockedMsg::New(message);
case kSrv2Cli_ClimbingWall_GameOver:
return pyClimbingWallGameOverMsg::New(message);
default:
PYTHON_RETURN_NONE;
}
}
///////////////////////////////////////////////////////////////////////////////
//
// The different messages we can receive
//
pyClimbingWallNumBlockersChangedMsg::pyClimbingWallNumBlockersChangedMsg(): pyClimbingWallMsg() {}
pyClimbingWallNumBlockersChangedMsg::pyClimbingWallNumBlockersChangedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_NumBlockersChanged))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallNumBlockersChangedMsg::NewBlockerCount() const
{
if (message)
{
const Srv2Cli_ClimbingWall_NumBlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_NumBlockersChanged*)message->netMsg;
return gmMsg->newBlockerCount;
}
return 0;
}
bool pyClimbingWallNumBlockersChangedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallReadyMsg::pyClimbingWallReadyMsg(): pyClimbingWallMsg() {}
pyClimbingWallReadyMsg::pyClimbingWallReadyMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_Ready))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallReadyMsg::ReadyType() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->readyType;
}
return 0;
}
bool pyClimbingWallReadyMsg::Team1Ready() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->team1Ready;
}
return false;
}
bool pyClimbingWallReadyMsg::Team2Ready() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->team2Ready;
}
return false;
}
bool pyClimbingWallReadyMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_Ready* gmMsg = (const Srv2Cli_ClimbingWall_Ready*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallBlockersChangedMsg::pyClimbingWallBlockersChangedMsg(): pyClimbingWallMsg() {}
pyClimbingWallBlockersChangedMsg::pyClimbingWallBlockersChangedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_BlockersChanged))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallBlockersChangedMsg::TeamNumber() const
{
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
return gmMsg->teamNumber;
}
return 0;
}
std::vector<int> pyClimbingWallBlockersChangedMsg::BlockersSet() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->blockersSet[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->blockersSet[i]);
}
}
return retVal;
}
bool pyClimbingWallBlockersChangedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_BlockersChanged* gmMsg = (const Srv2Cli_ClimbingWall_BlockersChanged*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallPlayerEnteredMsg::pyClimbingWallPlayerEnteredMsg(): pyClimbingWallMsg() {}
pyClimbingWallPlayerEnteredMsg::pyClimbingWallPlayerEnteredMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_PlayerEntered))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallSuitMachineLockedMsg::pyClimbingWallSuitMachineLockedMsg(): pyClimbingWallMsg() {}
pyClimbingWallSuitMachineLockedMsg::pyClimbingWallSuitMachineLockedMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_SuitMachineLocked))
message = nil; // wrong type, just clear it out
}
bool pyClimbingWallSuitMachineLockedMsg::Team1MachineLocked() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->team1MachineLocked;
}
return true; // err on the side of caution
}
bool pyClimbingWallSuitMachineLockedMsg::Team2MachineLocked() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->team2MachineLocked;
}
return true; // err on the side of caution
}
bool pyClimbingWallSuitMachineLockedMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_SuitMachineLocked* gmMsg = (const Srv2Cli_ClimbingWall_SuitMachineLocked*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}
///////////////////////////////////////////////////////////////////////////////
pyClimbingWallGameOverMsg::pyClimbingWallGameOverMsg(): pyClimbingWallMsg() {}
pyClimbingWallGameOverMsg::pyClimbingWallGameOverMsg(pfGameCliMsg* msg): pyClimbingWallMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_ClimbingWall_GameOver))
message = nil; // wrong type, just clear it out
}
int pyClimbingWallGameOverMsg::TeamWon() const
{
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
return gmMsg->teamWon;
}
return 0;
}
std::vector<int> pyClimbingWallGameOverMsg::Team1Blockers() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->team1Blockers[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->team1Blockers[i]);
}
}
return retVal;
}
std::vector<int> pyClimbingWallGameOverMsg::Team2Blockers() const
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
for (unsigned i = 0; i < kClimbingWallMaxBlockers; ++i)
{
if (gmMsg->team2Blockers[i] != kClimbingWallNoBlocker)
retVal.push_back(gmMsg->team2Blockers[i]);
}
}
return retVal;
}
bool pyClimbingWallGameOverMsg::LocalOnly() const
{
if (message)
{
const Srv2Cli_ClimbingWall_GameOver* gmMsg = (const Srv2Cli_ClimbingWall_GameOver*)message->netMsg;
return gmMsg->localOnly;
}
return true; // safe-guard so we don't screw up other's state if the python does something stupid
}

View File

@ -1,187 +1,187 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyClimbingWallMsg_h
#define pyClimbingWallMsg_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyClimbingWallMsg
//
// PURPOSE: Class wrapper for ClimbingWall game messages
//
#include "pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCliMsg.h"
class pyClimbingWallMsg : public pyGameCliMsg
{
protected:
pyClimbingWallMsg();
pyClimbingWallMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_EXPOSE_TYPE; // so we can subclass
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallMsg); // converts a PyObject to a pyClimbingWallMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaConstantsClasses(PyObject* m);
int GetClimbingWallMsgType() const;
PyObject* UpcastToFinalClimbingWallMsg() const; // returns the climbing wall message that this really is
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallNumBlockersChangedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallNumBlockersChangedMsg();
pyClimbingWallNumBlockersChangedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallNumBlockersChangedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallNumBlockersChangedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallNumBlockersChangedMsg); // converts a PyObject to a pyClimbingWallNumBlockersChangedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int NewBlockerCount() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallReadyMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallReadyMsg();
pyClimbingWallReadyMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallReadyMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallReadyMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallReadyMsg); // converts a PyObject to a pyClimbingWallReadyMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int ReadyType() const;
bool Team1Ready() const;
bool Team2Ready() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallBlockersChangedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallBlockersChangedMsg();
pyClimbingWallBlockersChangedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallBlockersChangedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallBlockersChangedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallBlockersChangedMsg); // converts a PyObject to a pyClimbingWallBlockersChangedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int TeamNumber() const;
std::vector<int> BlockersSet() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallPlayerEnteredMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallPlayerEnteredMsg();
pyClimbingWallPlayerEnteredMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallPlayerEnteredMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallPlayerEnteredMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallPlayerEnteredMsg); // converts a PyObject to a pyClimbingWallPlayerEnteredMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallSuitMachineLockedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallSuitMachineLockedMsg();
pyClimbingWallSuitMachineLockedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallSuitMachineLockedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallSuitMachineLockedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallSuitMachineLockedMsg); // converts a PyObject to a pyClimbingWallSuitMachineLockedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
bool Team1MachineLocked() const;
bool Team2MachineLocked() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallGameOverMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallGameOverMsg();
pyClimbingWallGameOverMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallGameOverMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallGameOverMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallGameOverMsg); // converts a PyObject to a pyClimbingWallGameOverMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int TeamWon() const;
std::vector<int> Team1Blockers() const;
std::vector<int> Team2Blockers() const;
bool LocalOnly() const;
};
#endif // pyClimbingWallMsg_h
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyClimbingWallMsg_h
#define pyClimbingWallMsg_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyClimbingWallMsg
//
// PURPOSE: Class wrapper for ClimbingWall game messages
//
#include "pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCliMsg.h"
class pyClimbingWallMsg : public pyGameCliMsg
{
protected:
pyClimbingWallMsg();
pyClimbingWallMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_EXPOSE_TYPE; // so we can subclass
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallMsg); // converts a PyObject to a pyClimbingWallMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaConstantsClasses(PyObject* m);
int GetClimbingWallMsgType() const;
PyObject* UpcastToFinalClimbingWallMsg() const; // returns the climbing wall message that this really is
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallNumBlockersChangedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallNumBlockersChangedMsg();
pyClimbingWallNumBlockersChangedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallNumBlockersChangedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallNumBlockersChangedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallNumBlockersChangedMsg); // converts a PyObject to a pyClimbingWallNumBlockersChangedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int NewBlockerCount() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallReadyMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallReadyMsg();
pyClimbingWallReadyMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallReadyMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallReadyMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallReadyMsg); // converts a PyObject to a pyClimbingWallReadyMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int ReadyType() const;
bool Team1Ready() const;
bool Team2Ready() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallBlockersChangedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallBlockersChangedMsg();
pyClimbingWallBlockersChangedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallBlockersChangedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallBlockersChangedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallBlockersChangedMsg); // converts a PyObject to a pyClimbingWallBlockersChangedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int TeamNumber() const;
std::vector<int> BlockersSet() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallPlayerEnteredMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallPlayerEnteredMsg();
pyClimbingWallPlayerEnteredMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallPlayerEnteredMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallPlayerEnteredMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallPlayerEnteredMsg); // converts a PyObject to a pyClimbingWallPlayerEnteredMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallSuitMachineLockedMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallSuitMachineLockedMsg();
pyClimbingWallSuitMachineLockedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallSuitMachineLockedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallSuitMachineLockedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallSuitMachineLockedMsg); // converts a PyObject to a pyClimbingWallSuitMachineLockedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
bool Team1MachineLocked() const;
bool Team2MachineLocked() const;
bool LocalOnly() const;
};
///////////////////////////////////////////////////////////////////////////////
class pyClimbingWallGameOverMsg : public pyClimbingWallMsg
{
protected:
pyClimbingWallGameOverMsg();
pyClimbingWallGameOverMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptClimbingWallGameOverMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyClimbingWallGameOverMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyClimbingWallGameOverMsg); // converts a PyObject to a pyClimbingWallGameOverMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
int TeamWon() const;
std::vector<int> Team1Blockers() const;
std::vector<int> Team2Blockers() const;
bool LocalOnly() const;
};
#endif // pyClimbingWallMsg_h

View File

@ -1,413 +1,413 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallMsg.h"
#include "../../pyEnum.h"
#include <python.h>
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall msg class
//
PYTHON_CLASS_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallMsg, getClimbingWallMsgType)
{
return PyInt_FromLong(self->fThis->GetClimbingWallMsgType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallMsg, upcastToFinalClimbingWallMsg)
{
return self->fThis->UpcastToFinalClimbingWallMsg();
}
PYTHON_START_METHODS_TABLE(ptClimbingWallMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallMsg, getClimbingWallMsgType, "Returns the type of the ClimbingWall message (see PtClimbingWallMsgTypes)"),
PYTHON_METHOD_NOARGS(ptClimbingWallMsg, upcastToFinalClimbingWallMsg, "Returns this message as the ClimbingWall msg it is"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallMsg, pyGameCliMsg, "Base class for ClimbingWall game messages");
PYTHON_EXPOSE_TYPE_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg);
// required functions for PyObject interoperability
PyObject* pyClimbingWallMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallMsg *newObj = (ptClimbingWallMsg*)ptClimbingWallMsg_type.tp_new(&ptClimbingWallMsg_type, NULL, NULL);
if (msg && (msg->gameCli->GetGameTypeId() == kGameTypeId_ClimbingWall))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallMsg, pyClimbingWallMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallMsg, pyClimbingWallMsg)
// Module and method definitions
void pyClimbingWallMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallMsg);
PYTHON_CLASS_IMPORT_END(m);
}
void pyClimbingWallMsg::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtClimbingWallMsgTypes);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallNumBlockersChanged, kSrv2Cli_ClimbingWall_NumBlockersChanged);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallReadyMsg, kSrv2Cli_ClimbingWall_Ready);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallBlockersChanged, kSrv2Cli_ClimbingWall_BlockersChanged);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallPlayerEntered, kSrv2Cli_ClimbingWall_PlayerEntered);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallSuitMachineLocked, kSrv2Cli_ClimbingWall_SuitMachineLocked);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallGameOver, kSrv2Cli_ClimbingWall_GameOver);
PYTHON_ENUM_END(m, PtClimbingWallMsgTypes);
}
///////////////////////////////////////////////////////////////////////////////
//
// Game client message subclasses
//
PYTHON_CLASS_DEFINITION(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallNumBlockersChangedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallNumBlockersChangedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallNumBlockersChangedMsg, newBlockerCount)
{
return PyInt_FromLong((long)self->fThis->NewBlockerCount());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallNumBlockersChangedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallNumBlockersChangedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallNumBlockersChangedMsg, newBlockerCount, "Returns the number of blockers this game is current running with"),
PYTHON_METHOD_NOARGS(ptClimbingWallNumBlockersChangedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallMsg, "ClimbingWall message received when the number of blockers is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallNumBlockersChangedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallNumBlockersChangedMsg *newObj = (ptClimbingWallNumBlockersChangedMsg*)ptClimbingWallNumBlockersChangedMsg_type.tp_new(&ptClimbingWallNumBlockersChangedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_NumBlockersChanged))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
// Module and method definitions
void pyClimbingWallNumBlockersChangedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallNumBlockersChangedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallReadyMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallReadyMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, readyType)
{
return PyInt_FromLong((long)self->fThis->ReadyType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, team1Ready)
{
PYTHON_RETURN_BOOL(self->fThis->Team1Ready());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, team2Ready)
{
PYTHON_RETURN_BOOL(self->fThis->Team2Ready());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallReadyMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, readyType, "The type of ready message this represents (see PtClimbingWallReadyTypes)"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, team1Ready, "Whether team 1 is ready or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, team2Ready, "Whether team 2 is ready or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallReadyMsg, pyClimbingWallMsg, "ClimbingWall message received when the ready state of the teams is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallReadyMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallReadyMsg *newObj = (ptClimbingWallReadyMsg*)ptClimbingWallReadyMsg_type.tp_new(&ptClimbingWallReadyMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_Ready))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
// Module and method definitions
void pyClimbingWallReadyMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallReadyMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallBlockersChangedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallBlockersChangedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, teamNumber)
{
return PyInt_FromLong((long)self->fThis->TeamNumber());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, blockersSet)
{
std::vector<int> blockers = self->fThis->BlockersSet();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallBlockersChangedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, teamNumber, "The team that this message is for"),
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, blockersSet, "Returns an array of blocker indicies denoting which blockers are set"),
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallBlockersChangedMsg, pyClimbingWallMsg, "ClimbingWall message received when the blocker state changes");
// required functions for PyObject interoperability
PyObject* pyClimbingWallBlockersChangedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallBlockersChangedMsg *newObj = (ptClimbingWallBlockersChangedMsg*)ptClimbingWallBlockersChangedMsg_type.tp_new(&ptClimbingWallBlockersChangedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_BlockersChanged))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
// Module and method definitions
void pyClimbingWallBlockersChangedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallBlockersChangedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallPlayerEnteredMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallPlayerEnteredMsg)
PYTHON_START_METHODS_TABLE(ptClimbingWallPlayerEnteredMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallPlayerEnteredMsg, pyClimbingWallMsg, "ClimbingWall message received when you successfully enter the suit machine");
// required functions for PyObject interoperability
PyObject* pyClimbingWallPlayerEnteredMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallPlayerEnteredMsg *newObj = (ptClimbingWallPlayerEnteredMsg*)ptClimbingWallPlayerEnteredMsg_type.tp_new(&ptClimbingWallPlayerEnteredMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_PlayerEntered))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
// Module and method definitions
void pyClimbingWallPlayerEnteredMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallPlayerEnteredMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallSuitMachineLockedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallSuitMachineLockedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, team1MachineLocked)
{
PYTHON_RETURN_BOOL(self->fThis->Team1MachineLocked());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, team2MachineLocked)
{
PYTHON_RETURN_BOOL(self->fThis->Team2MachineLocked());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallSuitMachineLockedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, team1MachineLocked, "Whether team 1's suit machine is locked or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, team2MachineLocked, "Whether team 2's suit machine is locked or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallMsg, "ClimbingWall message received when the locked state of the suit machines is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallSuitMachineLockedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallSuitMachineLockedMsg *newObj = (ptClimbingWallSuitMachineLockedMsg*)ptClimbingWallSuitMachineLockedMsg_type.tp_new(&ptClimbingWallSuitMachineLockedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_SuitMachineLocked))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
// Module and method definitions
void pyClimbingWallSuitMachineLockedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallSuitMachineLockedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallGameOverMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallGameOverMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, teamWon)
{
return PyInt_FromLong((long)self->fThis->TeamWon());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, team1Blockers)
{
std::vector<int> blockers = self->fThis->Team1Blockers();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, team2Blockers)
{
std::vector<int> blockers = self->fThis->Team2Blockers();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallGameOverMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, teamWon, "The team that won the game"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, team1Blockers, "Returns an array of blocker indicies denoting which blockers team 1 set"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, team2Blockers, "Returns an array of blocker indicies denoting which blockers team 2 set"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallGameOverMsg, pyClimbingWallMsg, "ClimbingWall message received when the game is over");
// required functions for PyObject interoperability
PyObject* pyClimbingWallGameOverMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallGameOverMsg *newObj = (ptClimbingWallGameOverMsg*)ptClimbingWallGameOverMsg_type.tp_new(&ptClimbingWallGameOverMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_GameOver))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
// Module and method definitions
void pyClimbingWallGameOverMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallGameOverMsg);
PYTHON_CLASS_IMPORT_END(m);
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyClimbingWallMsg.h"
#include "../../pyEnum.h"
#include <python.h>
///////////////////////////////////////////////////////////////////////////////
//
// Base climbing wall msg class
//
PYTHON_CLASS_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallMsg, getClimbingWallMsgType)
{
return PyInt_FromLong(self->fThis->GetClimbingWallMsgType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallMsg, upcastToFinalClimbingWallMsg)
{
return self->fThis->UpcastToFinalClimbingWallMsg();
}
PYTHON_START_METHODS_TABLE(ptClimbingWallMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallMsg, getClimbingWallMsgType, "Returns the type of the ClimbingWall message (see PtClimbingWallMsgTypes)"),
PYTHON_METHOD_NOARGS(ptClimbingWallMsg, upcastToFinalClimbingWallMsg, "Returns this message as the ClimbingWall msg it is"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallMsg, pyGameCliMsg, "Base class for ClimbingWall game messages");
PYTHON_EXPOSE_TYPE_DEFINITION(ptClimbingWallMsg, pyClimbingWallMsg);
// required functions for PyObject interoperability
PyObject* pyClimbingWallMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallMsg *newObj = (ptClimbingWallMsg*)ptClimbingWallMsg_type.tp_new(&ptClimbingWallMsg_type, NULL, NULL);
if (msg && (msg->gameCli->GetGameTypeId() == kGameTypeId_ClimbingWall))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallMsg, pyClimbingWallMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallMsg, pyClimbingWallMsg)
// Module and method definitions
void pyClimbingWallMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallMsg);
PYTHON_CLASS_IMPORT_END(m);
}
void pyClimbingWallMsg::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtClimbingWallMsgTypes);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallNumBlockersChanged, kSrv2Cli_ClimbingWall_NumBlockersChanged);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallReadyMsg, kSrv2Cli_ClimbingWall_Ready);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallBlockersChanged, kSrv2Cli_ClimbingWall_BlockersChanged);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallPlayerEntered, kSrv2Cli_ClimbingWall_PlayerEntered);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallSuitMachineLocked, kSrv2Cli_ClimbingWall_SuitMachineLocked);
PYTHON_ENUM_ELEMENT(PtClimbingWallMsgTypes, kClimbingWallGameOver, kSrv2Cli_ClimbingWall_GameOver);
PYTHON_ENUM_END(m, PtClimbingWallMsgTypes);
}
///////////////////////////////////////////////////////////////////////////////
//
// Game client message subclasses
//
PYTHON_CLASS_DEFINITION(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallNumBlockersChangedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallNumBlockersChangedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallNumBlockersChangedMsg, newBlockerCount)
{
return PyInt_FromLong((long)self->fThis->NewBlockerCount());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallNumBlockersChangedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallNumBlockersChangedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallNumBlockersChangedMsg, newBlockerCount, "Returns the number of blockers this game is current running with"),
PYTHON_METHOD_NOARGS(ptClimbingWallNumBlockersChangedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallMsg, "ClimbingWall message received when the number of blockers is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallNumBlockersChangedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallNumBlockersChangedMsg *newObj = (ptClimbingWallNumBlockersChangedMsg*)ptClimbingWallNumBlockersChangedMsg_type.tp_new(&ptClimbingWallNumBlockersChangedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_NumBlockersChanged))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallNumBlockersChangedMsg, pyClimbingWallNumBlockersChangedMsg)
// Module and method definitions
void pyClimbingWallNumBlockersChangedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallNumBlockersChangedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallReadyMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallReadyMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, readyType)
{
return PyInt_FromLong((long)self->fThis->ReadyType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, team1Ready)
{
PYTHON_RETURN_BOOL(self->fThis->Team1Ready());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, team2Ready)
{
PYTHON_RETURN_BOOL(self->fThis->Team2Ready());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallReadyMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallReadyMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, readyType, "The type of ready message this represents (see PtClimbingWallReadyTypes)"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, team1Ready, "Whether team 1 is ready or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, team2Ready, "Whether team 2 is ready or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallReadyMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallReadyMsg, pyClimbingWallMsg, "ClimbingWall message received when the ready state of the teams is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallReadyMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallReadyMsg *newObj = (ptClimbingWallReadyMsg*)ptClimbingWallReadyMsg_type.tp_new(&ptClimbingWallReadyMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_Ready))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallReadyMsg, pyClimbingWallReadyMsg)
// Module and method definitions
void pyClimbingWallReadyMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallReadyMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallBlockersChangedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallBlockersChangedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, teamNumber)
{
return PyInt_FromLong((long)self->fThis->TeamNumber());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, blockersSet)
{
std::vector<int> blockers = self->fThis->BlockersSet();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallBlockersChangedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallBlockersChangedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, teamNumber, "The team that this message is for"),
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, blockersSet, "Returns an array of blocker indicies denoting which blockers are set"),
PYTHON_METHOD_NOARGS(ptClimbingWallBlockersChangedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallBlockersChangedMsg, pyClimbingWallMsg, "ClimbingWall message received when the blocker state changes");
// required functions for PyObject interoperability
PyObject* pyClimbingWallBlockersChangedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallBlockersChangedMsg *newObj = (ptClimbingWallBlockersChangedMsg*)ptClimbingWallBlockersChangedMsg_type.tp_new(&ptClimbingWallBlockersChangedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_BlockersChanged))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallBlockersChangedMsg, pyClimbingWallBlockersChangedMsg)
// Module and method definitions
void pyClimbingWallBlockersChangedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallBlockersChangedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallPlayerEnteredMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallPlayerEnteredMsg)
PYTHON_START_METHODS_TABLE(ptClimbingWallPlayerEnteredMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallPlayerEnteredMsg, pyClimbingWallMsg, "ClimbingWall message received when you successfully enter the suit machine");
// required functions for PyObject interoperability
PyObject* pyClimbingWallPlayerEnteredMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallPlayerEnteredMsg *newObj = (ptClimbingWallPlayerEnteredMsg*)ptClimbingWallPlayerEnteredMsg_type.tp_new(&ptClimbingWallPlayerEnteredMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_PlayerEntered))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallPlayerEnteredMsg, pyClimbingWallPlayerEnteredMsg)
// Module and method definitions
void pyClimbingWallPlayerEnteredMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallPlayerEnteredMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallSuitMachineLockedMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallSuitMachineLockedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, team1MachineLocked)
{
PYTHON_RETURN_BOOL(self->fThis->Team1MachineLocked());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, team2MachineLocked)
{
PYTHON_RETURN_BOOL(self->fThis->Team2MachineLocked());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallSuitMachineLockedMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallSuitMachineLockedMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, team1MachineLocked, "Whether team 1's suit machine is locked or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, team2MachineLocked, "Whether team 2's suit machine is locked or not"),
PYTHON_METHOD_NOARGS(ptClimbingWallSuitMachineLockedMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallMsg, "ClimbingWall message received when the locked state of the suit machines is changed");
// required functions for PyObject interoperability
PyObject* pyClimbingWallSuitMachineLockedMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallSuitMachineLockedMsg *newObj = (ptClimbingWallSuitMachineLockedMsg*)ptClimbingWallSuitMachineLockedMsg_type.tp_new(&ptClimbingWallSuitMachineLockedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_SuitMachineLocked))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallSuitMachineLockedMsg, pyClimbingWallSuitMachineLockedMsg)
// Module and method definitions
void pyClimbingWallSuitMachineLockedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallSuitMachineLockedMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptClimbingWallGameOverMsg)
PYTHON_NO_INIT_DEFINITION(ptClimbingWallGameOverMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, teamWon)
{
return PyInt_FromLong((long)self->fThis->TeamWon());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, team1Blockers)
{
std::vector<int> blockers = self->fThis->Team1Blockers();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, team2Blockers)
{
std::vector<int> blockers = self->fThis->Team2Blockers();
PyObject* retVal = PyList_New(blockers.size());
for (unsigned i = 0; i < blockers.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(blockers[i])); // steals the ref
return retVal;
}
PYTHON_METHOD_DEFINITION_NOARGS(ptClimbingWallGameOverMsg, localOnly)
{
PYTHON_RETURN_BOOL(self->fThis->LocalOnly());
}
PYTHON_START_METHODS_TABLE(ptClimbingWallGameOverMsg)
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, teamWon, "The team that won the game"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, team1Blockers, "Returns an array of blocker indicies denoting which blockers team 1 set"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, team2Blockers, "Returns an array of blocker indicies denoting which blockers team 2 set"),
PYTHON_METHOD_NOARGS(ptClimbingWallGameOverMsg, localOnly, "Returns true if we are only supposed to adjust our stuff locally, and not net-prop it"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptClimbingWallGameOverMsg, pyClimbingWallMsg, "ClimbingWall message received when the game is over");
// required functions for PyObject interoperability
PyObject* pyClimbingWallGameOverMsg::New(pfGameCliMsg* msg)
{
ptClimbingWallGameOverMsg *newObj = (ptClimbingWallGameOverMsg*)ptClimbingWallGameOverMsg_type.tp_new(&ptClimbingWallGameOverMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_ClimbingWall_GameOver))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptClimbingWallGameOverMsg, pyClimbingWallGameOverMsg)
// Module and method definitions
void pyClimbingWallGameOverMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptClimbingWallGameOverMsg);
PYTHON_CLASS_IMPORT_END(m);
}