本文整理汇总了C++中Board::AddPost方法的典型用法代码示例。如果您正苦于以下问题:C++ Board::AddPost方法的具体用法?C++ Board::AddPost怎么用?C++ Board::AddPost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Board
的用法示例。
在下文中一共展示了Board::AddPost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CEVENT(CMDBoard, _ExitPost)
{
World* world = World::GetPtr();
Editor* ed = ((EditorExitedArgs*)args)->editor;
BoardPost* post = (BoardPost*)ed->GetArg();
Player* mobile = (Player*)caller;
BoardManager* bmanager = (BoardManager*)world->GetProperty("boards");
Property* prop = NULL;
Board* board = NULL;
int id = 0;
if (!bmanager)
{
mobile->Message(MSG_ERROR, "Can not access the board system.");
return;
}
prop = mobile->variables.FindProperty("board");
if (!prop)
{
mobile->Message(MSG_ERROR, "No board set.");
return;
}
id = prop->GetValue().GetInt();
board = bmanager->GetBoardByIndex(id);
if (!board)
{
mobile->Message(MSG_ERROR, "The board you have set does not exist.");
return;
}
board->AddPost(post);
}