示例#1
0
//
// evaluate
//
Value * RoleName_Method::evaluate (Ocl_Context & res, 
                                   GAME::Mga::Object caller)
{
	GAME::Mga::FCO nar = GAME::Mga::FCO::_narrow (caller);
	std::string name = nar->role ()->name ();
	return new String_Value (name);
}
示例#2
0
//
// evaluate
//
Value * RoleName_Method::evaluate (Ocl_Context & res, 
                                   Value * caller)
{
	Object_Value * iv = dynamic_cast <Object_Value *> (caller);
	std::string name = "";

	if (iv != 0)
	{
		GAME::Mga::Object obj = iv->value ();
		GAME::Mga::FCO nar = GAME::Mga::FCO::_narrow (obj);
		name = nar->role ()->name ();
	}

	return new String_Value (name);
}