Created a yet unused WmudWorld object for later world handling
This commit is contained in:
parent
419fc3fc7f
commit
fbf6e7ca6a
@ -20,6 +20,7 @@
|
||||
<xi:include href="xml/utils.xml"/>
|
||||
<xi:include href="xml/wmudclient.xml"/>
|
||||
<xi:include href="xml/wmudplayer.xml"/>
|
||||
<xi:include href="xml/wmudworld.xml"/>
|
||||
<xi:include href="xml/configuration.xml"/>
|
||||
<xi:include href="xml/maintenance-thread.xml"/>
|
||||
<xi:include href="xml/game-thread.xml"/>
|
||||
|
@ -67,6 +67,19 @@ wmud_player_set_player_name
|
||||
wmud_player_set_registered
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>WmudWorld</TITLE>
|
||||
<FILE>wmudworld</FILE>
|
||||
WMUD_IS_WORLD
|
||||
WMUD_IS_WORLD_CLASS
|
||||
WMUD_TYPE_WORLD
|
||||
WMUD_WORLD
|
||||
WMUD_WORLD_CLASS
|
||||
WMUD_WORLD_GET_CLASS
|
||||
WmudWorldPrivate
|
||||
wmud_world_new
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE></TITLE>
|
||||
<FILE>utils</FILE>
|
||||
|
@ -30,7 +30,9 @@ wmud_SOURCES = \
|
||||
wmudplayer.h \
|
||||
wmudclientstate.h \
|
||||
enumtypes.h \
|
||||
enumtypes.c
|
||||
enumtypes.c \
|
||||
wmudworld.c \
|
||||
wmudworld.h
|
||||
|
||||
wmud_LDADD = $(MEMCACHED_LIBS) $(GLIB_LIBS) $(GIO_LIBS) $(GTHREAD_LIBS) $(GDA_LIBS) $(CURL_LIBS)
|
||||
|
||||
|
70
wmud/wmudworld.c
Normal file
70
wmud/wmudworld.c
Normal file
@ -0,0 +1,70 @@
|
||||
/* wMUD - Yet another MUD codebase by W00d5t0ck
|
||||
* Copyright (C) 2012 - Gergely POLONKAI
|
||||
*
|
||||
* wmudworld.c: the WmudWorld object
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "wmudworld.h"
|
||||
|
||||
/**
|
||||
* SECTION:wmudworld
|
||||
* @short_description: wMUD World
|
||||
* @include: wmudworld.h
|
||||
*
|
||||
* #WmudWorld is for storing an online world
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE(WmudWorld, wmud_world, G_TYPE_OBJECT);
|
||||
|
||||
#define WMUD_WORLD_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WMUD_TYPE_WORLD, WmudWorldPrivate))
|
||||
|
||||
struct _WmudWorldPrivate
|
||||
{
|
||||
};
|
||||
|
||||
static void
|
||||
wmud_world_dispose(GObject *gobject)
|
||||
{
|
||||
G_OBJECT_CLASS(wmud_world_parent_class)->dispose(gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
wmud_world_finalize(GObject *gobject)
|
||||
{
|
||||
G_OBJECT_CLASS(wmud_world_parent_class)->finalize(gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
wmud_world_class_init(WmudWorldClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
|
||||
|
||||
gobject_class->dispose = wmud_world_dispose;
|
||||
gobject_class->finalize = wmud_world_finalize;
|
||||
|
||||
g_type_class_add_private(klass, sizeof(WmudWorldPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
wmud_world_init(WmudWorld *self)
|
||||
{
|
||||
self->priv = WMUD_WORLD_GET_PRIVATE(self);
|
||||
}
|
||||
|
||||
WmudWorld *
|
||||
wmud_world_new(void)
|
||||
{
|
||||
return g_object_new(WMUD_TYPE_WORLD, NULL, NULL);
|
||||
}
|
56
wmud/wmudworld.h
Normal file
56
wmud/wmudworld.h
Normal file
@ -0,0 +1,56 @@
|
||||
/* wMUD - Yet another MUD codebase by W00d5t0ck
|
||||
* Copyright (C) 2012 - Gergely POLONKAI
|
||||
*
|
||||
* wmudworld.h: header file for the WmudWorld object
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __WMUD_WMUDWORLD_H__
|
||||
#define __WMUD_WMUDWORLD_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define WMUD_TYPE_WORLD (wmud_world_get_type())
|
||||
#define WMUD_WORLD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WMUD_TYPE_WORLD, WmudWorld))
|
||||
#define WMUD_IS_WORLD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WMUD_TYPE_WORLD))
|
||||
#define WMUD_WORLD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WMUD_TYPE_WORLD, WmudWorldClass))
|
||||
#define WMUD_IS_WORLD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WMUD_TYPE_WORLD))
|
||||
#define WMUD_WORLD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WMUT_TYPE_WORLD, WmudWorldClass))
|
||||
|
||||
/**
|
||||
* WmudWorld:
|
||||
*
|
||||
* An online wMUD world
|
||||
*/
|
||||
typedef struct _WmudWorld WmudWorld;
|
||||
typedef struct _WmudWorldClass WmudWorldClass;
|
||||
typedef struct _WmudWorldPrivate WmudWorldPrivate;
|
||||
|
||||
struct _WmudWorld
|
||||
{
|
||||
/*<private>*/
|
||||
GObject parent_instance;
|
||||
WmudWorldPrivate *priv;
|
||||
};
|
||||
|
||||
struct _WmudWorldClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
WmudWorld *wmud_world_new(void);
|
||||
|
||||
#endif /* __WMUD_WMUDWORLD_H__ */
|
Loading…
Reference in New Issue
Block a user