• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GET_STATE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: if


//.........这里部分代码省略.........
	{
		if(ui.label_deathOverlay->isHidden())
		{
			ui.label_deathOverlay->show();
			ui.frame_top->hide();
			ui.label_aim->hide();
			ui.label_firingMode->hide();
			ui.frame_bottom->hide();
			schedulingHud.hide();

			ui.progressBar_health->hide();
			ui.progressBar_ammo->hide();
			
		}
	}
	else
	{
		if(!ui.label_deathOverlay->isHidden())
		{
			ui.label_deathOverlay->hide();
			ui.frame_top->show();
			ui.label_aim->show();
			ui.label_firingMode->show();
			ui.frame_bottom->show();
			schedulingHud.show();
		}
	}

	//
	// Update Scoreboard
	//

	scoreboard.refresh();
	if(ptr_player->detectedAsDead || GET_STATE() == STATE_GAMEOVER || ptr_player->showScoreboard)
	{
		if(ptr_player->showScoreboard)
			scoreboardFade = 0.0f;

		// Show scoreboard if delay has expired
		if(scoreboardFade > 0.0f)
			scoreboardFade -= SETTINGS->trueDeltaTime;
		if(scoreboardFade <= 0.0f)
		{
			// Show scoreboard if hidden
			if(ui.frame_scoreboard->isHidden())
			{
				hudMessage_manager.silenceAllMessages();
				ui.frame_scoreboard->show();
				ptr_player->isScoreBoardVisible = true;

				// Hide aim
				if(!ui.label_aim->isHidden())
				{
					ui.label_aim->hide();
					ui.label_firingMode->hide();
				}
			}
		}
	}
	else
	{
		// Reset scoreboard timer
		scoreboardFade = 2.0f;

		// Hide scoreboard if shown
		if(!ui.frame_scoreboard->isHidden())
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:67,代码来源:Menu_HUD.cpp


示例2: GET_STATE

void sc_generator::push_state(bool is_system)
{
	state->push_back(real_gen_state());
	GET_STATE().system_context = is_system;
}
开发者ID:energyfive,项目名称:sc-core,代码行数:5,代码来源:sc_generator.cpp


示例3: initng_depend_stop_dep_met

/*
 * This will check with plug-ins if dependencies for stop is met.
 * If this returns FALSE deps for stopping are not met, try again later.
 * If this returns FAIL stop deps, wont EVER be met, stop trying.
 */
int initng_depend_stop_dep_met(active_db_h * service, int verbose)
{
	active_db_h *currentA = NULL;
	int count = 0;

	assert(service);

	/*
	 * Check so all deps, that needs service, is down.
	 * if there are services depending on this one still running,
	 * return false and still try.
	 */
	while_active_db(currentA) {
		count++;
		if (service->depend_cache >= count)
			continue;

		/* temporary increase depend_cache - will degrese before
		 * reutrn (FALSE) */
		service->depend_cache++;

		if (currentA == service)
			continue;

		/* Does service depends on current ?? */
		if (initng_depend(currentA, service) == FALSE)
			continue;

		switch (GET_STATE(currentA)) {
		/* if its done, this is perfect */
		case IS_DOWN:
			continue;

		/* If the dep is failed, continue */
		case IS_FAILED:
			continue;

		/* BIG TODO.
		 * This is not correct, but if we wait for a service that is
		 * starting to stop, and that service is waiting for this
		 * service to start, until it starts, makes a deadlock.
		 *
		 * Asuming that STARTING services WAITING_FOR_START_DEP are
		 * down for now.
		 */
		case IS_STARTING:
			if (strstr(currentA->current_state->name,
				   "WAITING_FOR_START_DEP"))
				continue;
			break;
		}

#ifdef DEBUG
		/* else RETURN */
		if (verbose)
			D_("still waiting for service %s state %s\n",
			   currentA->name, currentA->current_state->name);
		else
			D_("still waiting for service %s state %s\n",
			   currentA->name, currentA->current_state->name);
#endif

		/* no, the dependency are not met YET */
		service->depend_cache--;
		return FALSE;
	}

	/* run the global module dep check */
	{
		s_event event;

		event.event_type = &EVENT_STOP_DEP_MET;
		event.data = service;

		initng_event_send(&event);
		if (event.status == FAILED) {
			if (verbose) {
				F_("Service %s can not be started because a "
				   "module (START_DEP_MET) says so.\n",
				   service->name);
			}

			return FALSE;
		}
	}

	service->depend_cache = 0;
	return TRUE;
}
开发者ID:initng,项目名称:initng,代码行数:94,代码来源:stop_dep_met.c


示例4: cState_allow_nan_p

/*
 * call-seq: allow_nan?
 *
 * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise
 * returns false.
 */
static VALUE cState_allow_nan_p(VALUE self)
{
    GET_STATE(self);
    return state->allow_nan ? Qtrue : Qfalse;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,代码来源:generator.c


示例5: cState_remember

/*
 * call-seq: remember(object)
 *
 * Remember _object_, to find out if it was already encountered (if a cyclic
 * data structure is rendered). 
 */
static VALUE cState_remember(VALUE self, VALUE object)
{
    GET_STATE(self);
    return rb_hash_aset(state->seen, rb_obj_id(object), Qtrue);
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,代码来源:generator.c


示例6: cState_array_nl

/*
 * call-seq: array_nl()
 *
 * This string is put at the end of a line that holds a JSON array.
 */
static VALUE cState_array_nl(VALUE self)
{
    GET_STATE(self);
    return state->array_nl;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,代码来源:generator.c


示例7: cState_check_circular_p

/*
 * call-seq: check_circular?
 *
 * Returns true, if circular data structures should be checked,
 * otherwise returns false.
 */
static VALUE cState_check_circular_p(VALUE self)
{
    GET_STATE(self);
    return state->check_circular ? Qtrue : Qfalse;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,代码来源:generator.c


示例8: cState_quirks_mode_set

/*
 * call-seq: quirks_mode=(enable)
 *
 * If set to true, enables the quirks_mode mode.
 */
static VALUE cState_quirks_mode_set(VALUE self, VALUE enable)
{
    GET_STATE(self);
    state->quirks_mode = RTEST(enable);
    return Qnil;
}
开发者ID:imageoptimiser,项目名称:json,代码行数:11,代码来源:generator.c


示例9: cState_depth

/*
 * call-seq: depth
 *
 * This integer returns the current depth of data structure nesting.
 */
static VALUE cState_depth(VALUE self)
{
    GET_STATE(self);
    return LONG2FIX(state->depth);
}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,代码来源:generator.c


示例10: cState_ascii_only_p

/*
 * call-seq: ascii_only?
 *
 * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise
 * returns false.
 */
static VALUE cState_ascii_only_p(VALUE self)
{
    GET_STATE(self);
    return state->ascii_only ? Qtrue : Qfalse;
}
开发者ID:imageoptimiser,项目名称:json,代码行数:11,代码来源:generator.c


示例11: cState_quirks_mode_p

/*
 * call-seq: quirks_mode?
 *
 * Returns true, if quirks mode is enabled. Otherwise returns false.
 */
static VALUE cState_quirks_mode_p(VALUE self)
{
    GET_STATE(self);
    return state->quirks_mode ? Qtrue : Qfalse;
}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,代码来源:generator.c


示例12: cState_max_nesting_set

/*
 * call-seq: max_nesting=(depth)
 *
 * This sets the maximum level of data structure nesting in the generated JSON
 * to the integer depth, max_nesting = 0 if no maximum should be checked.
 */
static VALUE cState_max_nesting_set(VALUE self, VALUE depth)
{
    GET_STATE(self);
    Check_Type(depth, T_FIXNUM);
    return state->max_nesting = FIX2LONG(depth);
}
开发者ID:imageoptimiser,项目名称:json,代码行数:12,代码来源:generator.c


示例13: cState_array_nl

/*
 * call-seq: array_nl()
 *
 * This string is put at the end of a line that holds a JSON array.
 */
static VALUE cState_array_nl(VALUE self)
{
    GET_STATE(self);
    return state->array_nl ? rb_str_new(state->array_nl, state->array_nl_len) : rb_str_new2("");
}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,代码来源:generator.c


示例14: cState_space_before

/*
 * call-seq: space_before()
 *
 * This string is used to insert a space before the ':' in JSON objects.
 */
static VALUE cState_space_before(VALUE self)
{
    GET_STATE(self);
    return state->space_before ? rb_str_new(state->space_before, state->space_before_len) : rb_str_new2("");
}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,代码来源:generator.c


示例15: cState_object_nl

/*
 * call-seq: object_nl()
 *
 * This string is put at the end of a line that holds a JSON object (or
 * Hash).
 */
static VALUE cState_object_nl(VALUE self)
{
    GET_STATE(self);
    return state->object_nl;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,代码来源:generator.c


示例16: cState_buffer_initial_length

/*
 * call-seq: buffer_initial_length
 *
 * This integer returns the current inital length of the buffer.
 */
static VALUE cState_buffer_initial_length(VALUE self)
{
    GET_STATE(self);
    return LONG2FIX(state->buffer_initial_length);
}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,代码来源:generator.c


示例17: cState_object_nl_set

/*
 * call-seq: object_nl=(object_nl)
 *
 * This string is put at the end of a line that holds a JSON object (or
 * Hash).
 */
static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
{
    GET_STATE(self);
    Check_Type(object_nl, T_STRING);
    return state->object_nl = object_nl;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:12,代码来源:generator.c


示例18: cState_configure

/*
 * call-seq: configure(opts)
 *
 * Configure this State instance with the Hash _opts_, and return
 * itself.
 */
static VALUE cState_configure(VALUE self, VALUE opts)
{
    VALUE tmp;
    GET_STATE(self);
    tmp = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
    if (NIL_P(tmp)) tmp = rb_convert_type(opts, T_HASH, "Hash", "to_h");
    if (NIL_P(tmp)) {
        rb_raise(rb_eArgError, "opts has to be hash like or convertable into a hash");
    }
    opts = tmp;
    tmp = rb_hash_aref(opts, ID2SYM(i_indent));
    if (RTEST(tmp)) {
        unsigned long len;
        Check_Type(tmp, T_STRING);
        len = RSTRING_LEN(tmp);
        state->indent = fstrndup(RSTRING_PTR(tmp), len + 1);
        state->indent_len = len;
    }
    tmp = rb_hash_aref(opts, ID2SYM(i_space));
    if (RTEST(tmp)) {
        unsigned long len;
        Check_Type(tmp, T_STRING);
        len = RSTRING_LEN(tmp);
        state->space = fstrndup(RSTRING_PTR(tmp), len + 1);
        state->space_len = len;
    }
    tmp = rb_hash_aref(opts, ID2SYM(i_space_before));
    if (RTEST(tmp)) {
        unsigned long len;
        Check_Type(tmp, T_STRING);
        len = RSTRING_LEN(tmp);
        state->space_before = fstrndup(RSTRING_PTR(tmp), len + 1);
        state->space_before_len = len;
    }
    tmp = rb_hash_aref(opts, ID2SYM(i_array_nl));
    if (RTEST(tmp)) {
        unsigned long len;
        Check_Type(tmp, T_STRING);
        len = RSTRING_LEN(tmp);
        state->array_nl = fstrndup(RSTRING_PTR(tmp), len + 1);
        state->array_nl_len = len;
    }
    tmp = rb_hash_aref(opts, ID2SYM(i_object_nl));
    if (RTEST(tmp)) {
        unsigned long len;
        Check_Type(tmp, T_STRING);
        len = RSTRING_LEN(tmp);
        state->object_nl = fstrndup(RSTRING_PTR(tmp), len + 1);
        state->object_nl_len = len;
    }
    tmp = ID2SYM(i_max_nesting);
    state->max_nesting = 100;
    if (option_given_p(opts, tmp)) {
        VALUE max_nesting = rb_hash_aref(opts, tmp);
        if (RTEST(max_nesting)) {
            Check_Type(max_nesting, T_FIXNUM);
            state->max_nesting = FIX2LONG(max_nesting);
        } else {
            state->max_nesting = 0;
        }
    }
    tmp = ID2SYM(i_depth);
    state->depth = 0;
    if (option_given_p(opts, tmp)) {
        VALUE depth = rb_hash_aref(opts, tmp);
        if (RTEST(depth)) {
            Check_Type(depth, T_FIXNUM);
            state->depth = FIX2LONG(depth);
        } else {
            state->depth = 0;
        }
    }
    tmp = ID2SYM(i_buffer_initial_length);
    if (option_given_p(opts, tmp)) {
        VALUE buffer_initial_length = rb_hash_aref(opts, tmp);
        if (RTEST(buffer_initial_length)) {
            long initial_length;
            Check_Type(buffer_initial_length, T_FIXNUM);
            initial_length = FIX2LONG(buffer_initial_length);
            if (initial_length > 0) state->buffer_initial_length = initial_length;
        }
    }
    tmp = rb_hash_aref(opts, ID2SYM(i_allow_nan));
    state->allow_nan = RTEST(tmp);
    tmp = rb_hash_aref(opts, ID2SYM(i_ascii_only));
    state->ascii_only = RTEST(tmp);
    tmp = rb_hash_aref(opts, ID2SYM(i_quirks_mode));
    state->quirks_mode = RTEST(tmp);
    return self;
}
开发者ID:imageoptimiser,项目名称:json,代码行数:96,代码来源:generator.c


示例19: cState_array_nl_set

/*
 * call-seq: array_nl=(array_nl)
 *
 * This string is put at the end of a line that holds a JSON array.
 */
static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
{
    GET_STATE(self);
    Check_Type(array_nl, T_STRING);
    return state->array_nl = array_nl;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,代码来源:generator.c


示例20: mArray_json_transfrom

inline static VALUE mArray_json_transfrom(VALUE self, VALUE Vstate, VALUE Vdepth) {
    long i, len = RARRAY_LEN(self);
    VALUE shift, result;
    long depth = NIL_P(Vdepth) ? 0 : FIX2LONG(Vdepth);
    VALUE delim = rb_str_new2(",");
    GET_STATE(Vstate);

    check_max_nesting(state, depth);
    if (state->check_circular) {
        VALUE self_id = rb_obj_id(self);
        rb_hash_aset(state->seen, self_id, Qtrue);
        result = rb_str_buf_new(len);
        if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl);
        shift = rb_str_times(state->indent, LONG2FIX(depth + 1));

        rb_str_buf_cat2(result, "[");
        OBJ_INFECT(result, self);
        rb_str_buf_append(result, state->array_nl);
        for (i = 0;  i < len; i++) {
            VALUE element = RARRAY_PTR(self)[i];
            if (RTEST(rb_hash_aref(state->seen, rb_obj_id(element)))) {
                rb_raise(eCircularDatastructure,
                        "circular data structures not supported!");
            }
            OBJ_INFECT(result, element);
            if (i > 0) rb_str_buf_append(result, delim);
            rb_str_buf_append(result, shift);
            element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1));
            Check_Type(element, T_STRING);
            rb_str_buf_append(result, element);
        }
        if (RSTRING_LEN(state->array_nl)) {
            rb_str_buf_append(result, state->array_nl);
            rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth)));
        }
        rb_str_buf_cat2(result, "]");
        rb_hash_delete(state->seen, self_id);
    } else {
        result = rb_str_buf_new(len);
        OBJ_INFECT(result, self);
        if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl);
        shift = rb_str_times(state->indent, LONG2FIX(depth + 1));

        rb_str_buf_cat2(result, "[");
        rb_str_buf_append(result, state->array_nl);
        for (i = 0;  i < len; i++) {
            VALUE element = RARRAY_PTR(self)[i];
            OBJ_INFECT(result, element);
            if (i > 0) rb_str_buf_append(result, delim);
            rb_str_buf_append(result, shift);
            element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1));
            Check_Type(element, T_STRING);
            rb_str_buf_append(result, element);
        }
        rb_str_buf_append(result, state->array_nl);
        if (RSTRING_LEN(state->array_nl)) {
            rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth)));
        }
        rb_str_buf_cat2(result, "]");
    }
    return result;
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:62,代码来源:generator.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GET_STR函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_SLOT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap