/* player.c generated by valac 0.34.0, the Vala compiler
 * generated from player.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (C) 2013 Michael Catanzaro
 *
 * This file is part of Iagno.
 *
 * Iagno 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 3 of the License, or
 * (at your option) any later version.
 *
 * Iagno 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 Iagno. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_PLAYER (player_get_type ())
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

typedef enum  {
	PLAYER_NONE,
	PLAYER_DARK,
	PLAYER_LIGHT
} Player;



GType player_get_type (void) G_GNUC_CONST;
gchar* player_to_string (Player self);
Player player_from_char (gchar c);
Player player_flip_color (Player p);


gchar* player_to_string (Player self) {
	gchar* result = NULL;
#line 29 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	switch (self) {
#line 29 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		case PLAYER_LIGHT:
#line 57 "player.c"
		{
			gchar* _tmp0_ = NULL;
#line 32 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			_tmp0_ = g_strdup ("L");
#line 32 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = _tmp0_;
#line 32 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 66 "player.c"
		}
#line 29 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		case PLAYER_DARK:
#line 70 "player.c"
		{
			gchar* _tmp1_ = NULL;
#line 34 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			_tmp1_ = g_strdup ("D");
#line 34 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = _tmp1_;
#line 34 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 79 "player.c"
		}
		default:
		{
			gchar* _tmp2_ = NULL;
#line 36 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			g_warn_if_fail (self == PLAYER_NONE);
#line 37 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			_tmp2_ = g_strdup (".");
#line 37 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = _tmp2_;
#line 37 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 92 "player.c"
		}
	}
}


Player player_from_char (gchar c) {
	Player result = 0;
	gchar _tmp0_ = '\0';
	gchar _tmp1_ = '\0';
	gchar _tmp2_ = '\0';
	gchar _tmp3_ = '\0';
#line 41 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp0_ = c;
#line 41 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp1_ = c;
#line 41 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp2_ = c;
#line 41 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_vala_return_val_if_fail (((_tmp0_ == 'L') || (_tmp1_ == 'D')) || (_tmp2_ == '.'), "c == 'L' || c == 'D' || c == '.'", 0);
#line 44 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp3_ = c;
#line 44 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	switch (_tmp3_) {
#line 44 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		case 'L':
#line 118 "player.c"
		{
#line 47 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = PLAYER_LIGHT;
#line 47 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 124 "player.c"
		}
#line 44 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		case 'D':
#line 128 "player.c"
		{
#line 49 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = PLAYER_DARK;
#line 49 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 134 "player.c"
		}
#line 44 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		case '.':
#line 138 "player.c"
		{
#line 51 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = PLAYER_NONE;
#line 51 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 144 "player.c"
		}
		default:
		{
#line 53 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			g_warn_if_reached ();
#line 54 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			result = PLAYER_NONE;
#line 54 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
			return result;
#line 154 "player.c"
		}
	}
}


Player player_flip_color (Player p) {
	Player result = 0;
	Player _tmp0_ = 0;
	Player _tmp1_ = 0;
	Player _tmp2_ = 0;
#line 58 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp0_ = p;
#line 58 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_vala_return_val_if_fail (_tmp0_ != PLAYER_NONE, "p != Player.NONE", 0);
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	_tmp2_ = p;
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	if (_tmp2_ == PLAYER_LIGHT) {
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		_tmp1_ = PLAYER_DARK;
#line 175 "player.c"
	} else {
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
		_tmp1_ = PLAYER_LIGHT;
#line 179 "player.c"
	}
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	result = _tmp1_;
#line 61 "/mnt/test/jhbuild/jhbuild/iagno/src/player.vala"
	return result;
#line 185 "player.c"
}


GType player_get_type (void) {
	static volatile gsize player_type_id__volatile = 0;
	if (g_once_init_enter (&player_type_id__volatile)) {
		static const GEnumValue values[] = {{PLAYER_NONE, "PLAYER_NONE", "none"}, {PLAYER_DARK, "PLAYER_DARK", "dark"}, {PLAYER_LIGHT, "PLAYER_LIGHT", "light"}, {0, NULL, NULL}};
		GType player_type_id;
		player_type_id = g_enum_register_static ("Player", values);
		g_once_init_leave (&player_type_id__volatile, player_type_id);
	}
	return player_type_id__volatile;
}



