summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgame/game-game.c15
-rw-r--r--libgame/game-game.h3
-rw-r--r--libgame/game-resource.h2
3 files changed, 19 insertions, 1 deletions
diff --git a/libgame/game-game.c b/libgame/game-game.c
index 2968824..67decd7 100644
--- a/libgame/game-game.c
+++ b/libgame/game-game.c
@@ -1100,3 +1100,18 @@ game_game_get_object (GameGame *game, const char *name)
return g_hash_table_lookup (game->named_objects, name);
}
+GameResource *
+game_game_get_resource (GameGame *game, const char *name)
+{
+ gpointer p;
+
+ g_return_val_if_fail (GAME_IS_GAME (game), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ p = g_hash_table_lookup (game->named_objects, name);
+ if (GAME_IS_RESOURCE (p))
+ return p;
+ else
+ return NULL;
+}
+
diff --git a/libgame/game-game.h b/libgame/game-game.h
index e3bc450..ff9d93d 100644
--- a/libgame/game-game.h
+++ b/libgame/game-game.h
@@ -39,6 +39,7 @@ typedef struct _GameGraphic GameGraphic;
typedef struct _GameGraphicClass GameGraphicClass;
typedef struct _GameMatch GameMatch;
typedef struct _GameMatchClass GameMatchClass;
+typedef struct _GameResource GameResource;
typedef struct _GameGame GameGame;
typedef struct _GameGameClass GameGameClass;
@@ -130,6 +131,8 @@ guint game_game_get_max_players (GameGame * game);
GameObject * game_game_get_object (GameGame * game,
const char * name);
+GameResource * game_game_get_resource (GameGame * game,
+ const char * name);
GameContainer * game_game_get_players (GameGame * game);
guint game_game_get_player_count (GameGame * game);
diff --git a/libgame/game-resource.h b/libgame/game-resource.h
index 0fe7aa7..81bb998 100644
--- a/libgame/game-resource.h
+++ b/libgame/game-resource.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
#define GAME_IS_RESOURCE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAME_TYPE_RESOURCE))
#define GAME_RESOURCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAME_TYPE_RESOURCE, GameResourceClass))
-typedef struct _GameResource GameResource;
+//typedef struct _GameResource GameResource;
typedef struct _GameResourceClass GameResourceClass;
struct _GameResource {