当前位置: 首页>>代码示例>>C++>>正文


C++ SetAction函数代码示例

本文整理汇总了C++中SetAction函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAction函数的具体用法?C++ SetAction怎么用?C++ SetAction使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetAction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void CGate::SetGate(WORD l)
{
	CBuild::SetBuild(l);
	switch (l)
	{
	case STATE_CLOSE:			//设置为关闭状态	
		{
			//当前状态不为损毁
			if (m_wState!=STATE_DIED)
			{
				MoveAroundPlayer();
				//设置阻挡
				SetAttribute("Action",ACT_IDLE);
				SetAttribute("State",STATE_FIGHT);
				SetAction(ACT_IDLE);				
			}
		}
		break;
	case STATE_OPEN:			//设置为打开状态	
		{
			if (m_wState!=STATE_DIED)
			{
				SetAttribute("Action",ACT_OPEN);
				SetAttribute("State",STATE_PEACE);
				SetAction(ACT_OPEN);			
			}
		}
		break;
	default:
		break;
	}
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:32,代码来源:CityGate.cpp

示例2: on_call_state

/*
 * Handler when invite state has changed.
 */
static void on_call_state (pjsua_call_id call_id, pjsip_event *e)
{
    pjsua_call_info call_info;

    PJ_UNUSED_ARG (e);

    pjsua_call_get_info (call_id, &call_info);

    if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) {

        g_current_call = PJSUA_INVALID_ID;
        SetURI (SIP_DST_URI, -1);
        SetAction (ID_MENU_CALL);
        //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen);
        SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen);

    } else {
        //if (g_current_call == PJSUA_INVALID_ID)
        //    g_current_call = call_id;

        if (call_info.remote_contact.slen)
            SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false);
        else
            SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false);

        if (call_info.state == PJSIP_INV_STATE_CONFIRMED)
            SetAction (ID_MENU_DISCONNECT);

        SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen);
    }
}
开发者ID:max3903,项目名称:SFLphone,代码行数:34,代码来源:pjsua_wince.cpp

示例3: Flacker

func Flacker()
{
  if(Not(Random(15))) And(CastObjects(SU3V,Sum(1,Random(1)),Sum(5,Random(15)),Sum(-14,Random(28)),Sum(1,Random(2))),Sound("Spark*"));
  if(Not(Random(2))) return(0);
  if(Random(6)) return(ObjectSetAction(Local(0),"Neon")&&SetAction("FlackerAn"));
  if(Random(6)) return(ObjectSetAction(Local(0),"Aus")&&SetAction("FlackerAus"));
  return(1);
}
开发者ID:Fulgen301,项目名称:SGGP,代码行数:8,代码来源:Script.c

示例4: Piccheck

func Piccheck()
{
  if(FindContents(ZPM_))
  {
   SetVisibility(VIS_All());
   SetAction(GetAction(FindContents(ZPM_)));
  }
  else
  {
   SetAction("Inactive");
   SetVisibility(VIS_None());
  }
  return(1);
}
开发者ID:maxmitti,项目名称:SGGP,代码行数:14,代码来源:Script.c

示例5: M_GetMapLayer

void NDPlayer::OnMoveEnd()
{
	ScriptGlobalEvent::OnEvent(GE_ONMOVE_END);

	NDMapLayer* pkMaplayer = M_GetMapLayer();
	if (pkMaplayer)
	{
		pkMaplayer->ShowRoadSign(false);
	}

	if (!isTeamLeader() && isTeamMember())
	{
		return;
	}

	SetAction(false);
	NDManualRole::OnMoveEnd();
	if (isTeamLeader())
	{
		teamMemberAction(false);
	}
	//玩家停下来的时候 做聚焦改变处理	npc加载完成后,也做一次聚焦改变处理
	UpdateFocus();

	if (AutoPathTipObj.IsWorking())
	{
		AutoPathTipObj.Arrive();
	}
	processSwitch();
}
开发者ID:chaosren,项目名称:HHHH,代码行数:30,代码来源:NDPlayer.cpp

示例6: Initialize

protected func Initialize()
{
  SetAction("Connect");  
  SetVertexXY(0, GetX(), GetY());
  SetVertexXY(1, GetX(), GetY());
  SetPosition(0, 0);
}
开发者ID:lluchs,项目名称:ClonkMars,代码行数:7,代码来源:Script.c

示例7: ChargeStop

func ChargeStop(proplist params)
{
	SetAction("Idle");
	var angle = params.new_angle;
	SetVelocity(angle, Speed-10, 10);
	
	Sound("sawblade_launch", false, 100);
	
	AddEffect("CheckEnemies", this, 1,1, this);
	
	SetLightRange(30, 70);
	SetLightColor(RGB(150, 150, 150));
	
	AddEffect("Life", this, 20, LifeTime, this);

	/*if(GetXDir() > 0)
		SetRDir(15);
	else
		SetRDir(-15);*/
	
	SetClrModulation(RGBa(255,255,255,255));
	Sound("sawloop", false, 20, nil, 1);
	
	AddEffect("Rotate", this, 1, 1, this);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:25,代码来源:Script.c

示例8: HitByHook

func HitByHook(hook)
{
	if(!snapped)
		return;
		
	Unstuck();
	snapped = 0;
	var fx = GetEffect("Travel", this);
	RemoveEffect("Travel", this);
	SetAction("Idle");
	
	/*
	var dir;
	if(GetX() > hook->GetX())
		dir = 1;
	else
		dir = -1;*/
		
	var angle = Angle(hook->GetX(), hook->GetY(), GetX(), GetY());
	
	//var angle = fx.angle - 45 * -fx.dir;
	var xdir = Sin(angle, Speed);
	var ydir = -Cos(angle, Speed);
	//var xdir = Cos(angle, Speed);
	//var ydir = Sin(angle, Speed);
	Bounce(xdir, ydir);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:27,代码来源:Script.c

示例9: Initialize

func Initialize()
{
  temp = 0;
  SetAction("Open");
  open = 1;
  return(1);
}
开发者ID:maxmitti,项目名称:SGGP,代码行数:7,代码来源:Script.c

示例10: Initialize

protected func Initialize() 
{ 
  // Zufällige Größe
  if (Random(5))
    DoCon(-Random(20) - 40);
  else
    DoCon(-Random(50) - 20);
  // Zufällige Form  
  SetAction("Grass");
  SetPhase(Random(2));
  if (!Random(20)) SetPhase(2);
  // Zufällige Richtung
  if (Random(2)) SetDir(DIR_Right);
  // Drehung nach Erdoberfläche
  var x_off = 18 * GetCon() / 100;
  var y_off = 15 * GetCon() / 100;
  var slope = GetSolidOffset(-x_off, y_off) - GetSolidOffset(x_off, y_off);
  SetR(slope);
  // Höhe anpassen
  while (!GBackSolid(0, 5))
    SetPosition(GetX(), GetY() + 1);
  // Gras bleibt hinter Bäumen
  MoveBehindTrees();
  ScheduleCall(0, "ListenToTime", 1);
}
开发者ID:lluchs,项目名称:Clinfinity,代码行数:25,代码来源:Script.c

示例11: SetAction

void CSinaSvr::Login(LPCTSTR lpUserName,LPCTSTR lpPwd)
{

	SetAction(ACT_LOGIN_SINA);
	TCHAR szPost[1024]= {0};
	_stprintf(szPost,_T("username=%s&password=%s&entry=miniblog&act=1&from=referer%3Awww_index"),lpUserName,lpPwd);

	int iSize = _tcslen(szPost);

	CByteArray arr;
	for (int i = 0; i < iSize; i++)
	{
		arr.Add(szPost[i]);
	}

	TCHAR szHeader[1024] = _T("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");

	TCHAR szURL[1024]=_T("http://login.sina.com.cn/sso/login.php");
	COleVariant vPostData = arr;
	COleVariant vURL(szURL, VT_BSTR);
	COleVariant vHeaders(szHeader, VT_BSTR);
	COleVariant vTargetFrameName((LPCTSTR)NULL, VT_BSTR);
	COleVariant vFlags((long) NULL, VT_I4);
	Navigate2(vURL, vFlags, vTargetFrameName,vPostData, vHeaders);

}
开发者ID:shzhqiu,项目名称:weibo,代码行数:26,代码来源:SinaBrowserTool.cpp

示例12: Init

func Init(to, max, cur, timeout, offset, visibility, proplist data)
{
	maximum = max;
	current = cur;
	timeout_time = timeout;
	
	width = data.width ?? 40;
	height = data.height ?? 5;

	
	if(timeout_time)
	{
		var e = AddEffect("TimeOut", this, 1, BoundBy(timeout_time/2, 5, 35), this);
		e.t = timeout_time;
	}
	
	this.Visibility = visibility;
	
	SetGraphics(nil, GetID(), 1, GFXOV_MODE_Base, nil, GFX_BLIT_Custom);
	SetBarColor(data.color, data.back_color);
	
	SetAction("Attach", to);
	SetVertexXY(0, -offset.x, -offset.y);
	
	AddEffect("LifeCheck", to, 1, 0, this);
	Update();
}
开发者ID:772,项目名称:openclonk,代码行数:27,代码来源:Script.c

示例13: An

func An()
{
  if(Local(0)) return(1);
  SetAction("An");
  ObjectSetAction(Local(0)=CreateObject(LJ3V,-20,16),"Neon");
  return(1);
}
开发者ID:Fulgen301,项目名称:SGGP,代码行数:7,代码来源:Script.c

示例14: Updatable

// spawner instantiation constructor
Spawner::Spawner(const SpawnerTemplate &aTemplate, unsigned int aId)
: Updatable(aId)
, mTrack(0)
, mTimer(-aTemplate.mStart)
{
	SetAction(Action(this, &Spawner::Update));
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:8,代码来源:Spawner.cpp

示例15: Updatable

StateMachine::StateMachine(unsigned int aId)
: Updatable(aId)
, mActiveId(0)
{
	// if the database has a "start" state...
	if (const StateTemplate *state = Database::statetemplate.Get(mId).Find(0x652b04df /* "start" */))
	{
		// start in the start state (naturally)
		mActiveId = 0x652b04df /* "start" */;
		state->Enter(mId);
	}
	else
	{
		// start in the first state
		Database::Typed<StateTemplate>::Iterator itor(Database::statetemplate.Find(mId));
		if (itor.IsValid())
		{
			mActiveId = itor.GetKey();
			itor.GetValue().Enter(mId);
		}
	}

	SetAction(Action(this, &StateMachine::Update));
	Activate();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:25,代码来源:State.cpp


注:本文中的SetAction函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。