Class Joyau::CollisionType
In: Drawable.cpp
Parent: Object

Allows to tell where collisions should be checked for an object (e.g. tiles).

Methods

content   content=   down   down=   left   left=   new   right   right=   up   up=  

Public Class methods

Creates a new collision type. The arguments are either true or false, indicating where the collision should be checked.

[Source]

/*
  call-seq: new()
            new(content [, left, right, up, down])

  Creates a new collision type. The arguments are either true or false,
  indicating where the collision should be checked.
*/
VALUE wrap<CollisionType>(int argc, VALUE *argv, VALUE info)
{
   CollisionType *ptr = new CollisionType;
   if (argc >= 1)
   {
      ptr->content = argv[0] == Qtrue;
      if (argc >= 5)
      {
         ptr->left = argv[1] == Qtrue;
         ptr->right = argv[2] == Qtrue;
         ptr->up = argv[3] == Qtrue;
         ptr->down = argv[4] == Qtrue;
      }
   }

   VALUE tdata = Data_Wrap_Struct(info, 0, wrapped_free<CollisionType>, ptr);
   return tdata;
}

Public Instance methods

Returns whether collisions are checked for the item’s content.

[Source]

/*
  Returns whether collisions are checked for the item's content.
*/
VALUE CollisionType_content(VALUE self)
{
   CollisionType &ref = getRef<CollisionType>(self);
   return ref.content ? Qtrue : Qfalse;
}

Sets whether collision should be checked for the item’s content.

[Source]

/*
  call-seq: content=(val)

  Sets whether collision should be checked for the item's content.
*/
VALUE CollisionType_setContent(VALUE self, VALUE val)
{
   CollisionType &ref = getRef<CollisionType>(self);
   ref.content = val == Qtrue;

   return val;
}

Returns whether collisions are checked for the downer side.

[Source]

/*
  Returns whether collisions are checked for the downer side.
*/
VALUE CollisionType_down(VALUE self)
{
   CollisionType &ref = getRef<CollisionType>(self);
   return ref.down ? Qtrue : Qfalse;
}

Sets whether collision should be checked for the downer side.

[Source]

/*
  call-seq: down=(val)

  Sets whether collision should be checked for the downer side.
*/
VALUE CollisionType_setDown(VALUE self, VALUE val)
{
   CollisionType &ref = getRef<CollisionType>(self);
   ref.down = val == Qtrue;

   return val;
}

Returns whether collisions are checked for the left side.

[Source]

/*
  Returns whether collisions are checked for the left side.
*/
VALUE CollisionType_left(VALUE self)
{
   CollisionType &ref = getRef<CollisionType>(self);
   return ref.left ? Qtrue : Qfalse;
}

cal0l-seq: left=(val)

Sets whether collision should be checked for the left side.

[Source]

/*
  cal0l-seq: left=(val)

  Sets whether collision should be checked for the left side.
*/
VALUE CollisionType_setLeft(VALUE self, VALUE val)
{
   CollisionType &ref = getRef<CollisionType>(self);
   ref.left = val == Qtrue;

   return val;
}

Returns whether collisions are checked for the right side.

[Source]

/*
  Returns whether collisions are checked for the right side.
*/
VALUE CollisionType_right(VALUE self)
{
   CollisionType &ref = getRef<CollisionType>(self);
   return ref.right ? Qtrue : Qfalse;
}

Sets whether collision should be checked for the right side.

[Source]

/*
  call-seq: right=(val)

  Sets whether collision should be checked for the right side.
*/
VALUE CollisionType_setRight(VALUE self, VALUE val)
{
   CollisionType &ref = getRef<CollisionType>(self);
   ref.right = val == Qtrue;

   return val;
}

Returns whether collisions are checked for the upper side.

[Source]

/*
  Returns whether collisions are checked for the upper side.
*/
VALUE CollisionType_up(VALUE self)
{
   CollisionType &ref = getRef<CollisionType>(self);
   return ref.up ? Qtrue : Qfalse;
}

Sets whether collision should be checked for the upper side.

[Source]

/*
  call-seq: up=(val)

  Sets whether collision should be checked for the upper side.
*/
VALUE CollisionType_setUp(VALUE self, VALUE val)
{
   CollisionType &ref = getRef<CollisionType>(self);
   ref.up = val == Qtrue;

   return val;
}

[Validate]