本文整理汇总了C++中atlas::objects::entity::Anonymous类的典型用法代码示例。如果您正苦于以下问题:C++ Anonymous类的具体用法?C++ Anonymous怎么用?C++ Anonymous使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Anonymous类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGoalInfo
void EntityEditor::getGoalInfo(const std::string& id)
{
Eris::Account* account = EmberServices::getSingleton().getServerService().getAccount();
Atlas::Objects::Operation::Generic get;
std::list<std::string> parents;
parents.emplace_back("commune");
get->setParents(parents);
get->setTo(mEntity.getId());
//By setting it TO an entity and FROM our avatar we'll make the server deliver it as
//if it came from the entity itself (the server rewrites the FROM to be of the entity).
get->setFrom(mWorld.getAvatar()->getEmberEntity().getId());
//By setting a serial number we tell the server to "relay" the operation. This means that any
//response operation from the target entity will be sent back to us.
get->setSerialno(Eris::getNewSerialno());
Atlas::Message::MapType goalMap;
goalMap["id"] = id;
Atlas::Objects::Entity::Anonymous getArg;
getArg->setAttr("goal_info", goalMap);
get->setArgs1(getArg);
Eris::Connection* connection = account->getConnection();
connection->getResponder()->await(get->getSerialno(), this, &EntityEditor::operationGetGoalInfoResult);
connection->send(get);
}
示例2: removeGoal
void EntityEditor::removeGoal(const std::string& id)
{
Eris::Account* account = EmberServices::getSingleton().getServerService().getAccount();
Atlas::Message::MapType goalElement;
goalElement["id"] = id;
//By not defining anything else than the id we're telling the server to remove it.
Atlas::Objects::Entity::Anonymous thought;
thought->setAttr("goal", goalElement);
Atlas::Objects::Operation::RootOperation thinkOp;
thinkOp->setArgs1(thought);
std::list<std::string> parents;
parents.emplace_back("think");
thinkOp->setParents(parents);
thinkOp->setTo(mEntity.getId());
//By setting it TO an entity and FROM our avatar we'll make the server deliver it as
//if it came from the entity itself (the server rewrites the FROM to be of the entity).
thinkOp->setFrom(mWorld.getAvatar()->getEmberEntity().getId());
Eris::Connection* connection = account->getConnection();
connection->send(thinkOp);
}
示例3: actuate
void ConnectedAdapter::actuate(Eris::Entity* entity, const std::string& action)
{
try {
Atlas::Objects::Entity::Anonymous what;
what->setId(entity->getId());
// what->setObjtype("obj");
Atlas::Objects::Operation::RootOperation actionOp;
actionOp->setObjtype("op");
actionOp->setArgs1(what);
std::list<std::string> actionParents;
actionParents.push_back(action);
actionOp->setParents(actionParents);
Atlas::Objects::Operation::RootOperation actuateOp;
actuateOp->setObjtype("op");
actuateOp->setArgs1(actionOp);
std::list<std::string> actuateParents;
actuateParents.push_back("actuate");
actuateOp->setParents(actuateParents);
actuateOp->setFrom(mAvatar.getEntity()->getId());
S_LOG_INFO("Actuating entity with id " << entity->getId() << ", named " << entity->getName() << " with action '" << action << "'.");
mConnection.send(actuateOp);
} catch (const std::exception& ex) {
S_LOG_WARNING("Got error on actuating." << ex);
}
}
示例4: wield
void ConnectedAdapter::wield(Eris::Entity* entity, const std::string& outfitSlot)
{
try {
if (entity->getLocation() != mAvatar.getEntity()) {
S_LOG_WARNING("Can't wield an Entity which is not located in the avatar.");
return;
}
Atlas::Objects::Entity::Anonymous arguments;
arguments->setId(entity->getId());
if (outfitSlot != "") {
arguments->setAttr("outfit", outfitSlot);
}
Atlas::Objects::Operation::Wield wield;
wield->setFrom(mAvatar.getEntity()->getId());
wield->setArgs1(arguments);
mConnection.send(wield);
} catch (const std::exception& ex) {
S_LOG_WARNING("Got error on wielding." << ex);
}
}
示例5: atlasClass
Root atlasClass(const std::string & name, const std::string & parent)
{
Atlas::Objects::Entity::Anonymous r;
r->setParents(std::list<std::string>(1, parent));
r->setObjtype("class");
r->setId(name);
return r;
}
示例6: atlasOpDefinition
Root atlasOpDefinition(const std::string & name, const std::string & parent)
{
Atlas::Objects::Entity::Anonymous r;
r->setParents(std::list<std::string>(1, parent));
r->setObjtype("op_definition");
r->setId(name);
return r;
}
示例7: atlasType
Root atlasType(const std::string & name,
const std::string & parent,
bool abstract)
{
Atlas::Objects::Entity::Anonymous r;
r->setParents(std::list<std::string>(1, parent));
r->setObjtype(abstract ? "data_type" : "type");
r->setId(name);
return r;
}
示例8: test_unseenOperation
void BaseMindtest::test_unseenOperation()
{
OpVector res;
Atlas::Objects::Operation::Unseen op;
bm->operation(op, res);
Atlas::Objects::Entity::Anonymous arg;
op->setArgs1(arg);
bm->operation(op, res);
arg->setId("2");
bm->operation(op, res);
}
示例9: test_disappearanceOperation
void BaseMindtest::test_disappearanceOperation()
{
OpVector res;
Atlas::Objects::Operation::Disappearance op;
bm->operation(op, res);
Atlas::Objects::Entity::Anonymous arg;
op->setArgs1(arg);
bm->operation(op, res);
arg->setId("2");
bm->operation(op, res);
}
示例10: irrelevant
Py::Object CyPy_Task::irrelevant(const Py::Tuple& args)
{
m_value->irrelevant();
if (args.size() > 0) {
args.verify_length(1);
Atlas::Objects::Operation::Error e;
Atlas::Objects::Entity::Anonymous arg;
arg->setAttr("message", verifyString(args.front()));
e->modifyArgs().push_back(arg);
e->setTo(m_value->m_usageInstance.actor->getId());
return CyPy_Operation::wrap(e);
}
return Py::None();
}
示例11: eat
void ConnectedAdapter::eat(Eris::Entity* entity)
{
try {
Atlas::Objects::Entity::Anonymous what;
what->setId(entity->getId());
Atlas::Objects::Operation::Generic op;
op->setType("eat", -1);
op->setFrom(mAvatar.getEntity()->getId());
op->setArgs1(what);
S_LOG_INFO("Eating entity with id " << entity->getId() << ", named " << entity->getName());
mConnection.send(op);
} catch (const std::exception& ex) {
S_LOG_WARNING("Got error on eating entity." << ex);
}
}
示例12: deleteEntity
void ConnectedAdapter::deleteEntity(Eris::Entity* entity)
{
try {
Atlas::Objects::Entity::Anonymous what;
what->setId(entity->getId());
Atlas::Objects::Operation::Delete deleteOp;
deleteOp->setFrom(mAvatar.getEntity()->getId());
deleteOp->setTo(entity->getId());
deleteOp->setArgs1(what);
S_LOG_INFO("Deleting entity with id " << entity->getId() << ", named " << entity->getName());
mConnection.send(deleteOp);
} catch (const std::exception& ex) {
S_LOG_WARNING("Got error on deleting entity." << ex);
}
}
示例13: test_sightSetOperation
void BaseMindtest::test_sightSetOperation()
{
Atlas::Objects::Operation::Set sub_op;
Atlas::Objects::Operation::Sight op;
op->setArgs1(sub_op);
OpVector res;
bm->operation(op, res);
sub_op->setArgs1(Atlas::Objects::Entity::Anonymous());
bm->operation(op, res);
sub_op->setArgs1(Atlas::Objects::Entity::Anonymous(0));
bm->operation(op, res);
Atlas::Objects::Entity::Anonymous arg;
arg->setId("2");
sub_op->setArgs1(arg);
bm->operation(op, res);
}
示例14: test_MemMap_updateAdd_location_properties_have_effect
void BaseMindMapEntityintegration::test_MemMap_updateAdd_location_properties_have_effect()
{
MemEntity * tlve = new MemEntity("0", 0);
Location location(tlve);
BBox bbox(WFMath::Point<3>(1,2,3), WFMath::Point<3>(4,5,6));
location.setBBox(bbox);
{
Atlas::Objects::Entity::Anonymous args;
location.addToEntity(args);
args->setAttr("id", "0");
m_mind->m_map.updateAdd(args, 1.0f);
}
MemEntity* ent = m_mind->m_map.get("0");
ASSERT_EQUAL("0", ent->getId());
ASSERT_EQUAL(bbox, ent->m_location.m_bBox);
ASSERT_TRUE(ent->m_location.isSolid());
ASSERT_TRUE(ent->m_location.isSimple());
BBox bbox2(WFMath::Point<3>(10,20,30), WFMath::Point<3>(40,50,60));
location.setBBox(bbox2);
{
Atlas::Objects::Entity::Anonymous args;
location.addToEntity(args);
args->setAttr("id", "0");
args->setAttr("solid", 0);
args->setAttr("simple", 0);
m_mind->m_map.updateAdd(args, 2.0f);
}
ent = m_mind->m_map.get("0");
ASSERT_EQUAL(bbox2, ent->m_location.m_bBox);
ASSERT_TRUE(!ent->m_location.isSolid());
ASSERT_TRUE(!ent->m_location.isSimple());
}
示例15: adminTell
void ConnectedAdapter::adminTell(const std::string& entityId, const std::string& attribute, const std::string &value)
{
try {
Atlas::Objects::Entity::Anonymous what;
what->setAttr(attribute, value);
Atlas::Objects::Operation::Talk talk;
talk->setFrom(entityId);
talk->setTo(entityId);
talk->setArgs1(what);
Atlas::Objects::Operation::Sound sound;
sound->setFrom(mAvatar.getEntity()->getId());
sound->setTo(entityId);
sound->setArgs1(talk);
mConnection.send(sound);
} catch (const std::exception& ex) {
S_LOG_WARNING("Got error on admin_tell." << ex);
}
}