Sha256: 02a2e2edca628af0b5078fc4b7ffcb88f9e578c7d2d29c204ad4306f5f17d9f1

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

#include "reflex/ruby/event.h"


#include <rucy.h>
#include "defs.h"


using namespace Rucy;


RUCY_DEFINE_VALUE_FROM_TO(Reflex::UpdateEvent)

#define THIS  to<Reflex::UpdateEvent*>(self)

#define CHECK RUCY_CHECK_OBJ(Reflex::UpdateEvent, self)


static
RUCY_DEF_ALLOC(alloc, klass)
{
	return new_type<Reflex::UpdateEvent>(klass);
}
RUCY_END

static
RUCY_DEFN(initialize)
{
	CHECK;
	check_arg_count(__FILE__, __LINE__, "UpdateEvent#initialize", argc, 0, 1);

	THIS->dt = (argc >= 1) ? argv[0].as_f() : 0;

	return rb_call_super(0, NULL);
}
RUCY_END

static
RUCY_DEF1(initialize_copy, obj)
{
	CHECK;
	*THIS = to<Reflex::UpdateEvent&>(obj);
	return self;
}
RUCY_END

static
RUCY_DEF0(dt)
{
	CHECK;
	return value(THIS->dt);
}
RUCY_END


static Class cUpdateEvent;

void
Init_update_event ()
{
	Module mReflex = define_module("Reflex");

	cUpdateEvent = mReflex.define_class("UpdateEvent", Reflex::event_class());
	cUpdateEvent.define_alloc_func(alloc);
	cUpdateEvent.define_private_method("initialize", initialize);
	cUpdateEvent.define_private_method("initialize_copy", initialize_copy);
	cUpdateEvent.define_method("dt", dt);
}


namespace Reflex
{


	Class
	update_event_class ()
	{
		return cUpdateEvent;
	}


}// Reflex

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reflexion-0.1.12 ext/reflex/update_event.cpp
reflexion-0.1.11 ext/reflex/update_event.cpp
reflexion-0.1.10 ext/reflex/update_event.cpp
reflexion-0.1.9.1 ext/reflex/update_event.cpp
reflexion-0.1.9 ext/reflex/update_event.cpp
reflexion-0.1.8 ext/reflex/update_event.cpp