bygfoot/src/news_struct.h

98 lines
3.0 KiB
C
Raw Permalink Normal View History

2008-11-27 14:24:18 +01:00
/*
news_struct.h
Bygfoot Football Manager -- a small and simple GTK2-based
football management game.
http://bygfoot.sourceforge.net
Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com)
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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NEWS_STRUCT_H
#define NEWS_STRUCT_H
/** Enumeration of news article types. */
enum NewsArticleTypes
{
2008-11-28 15:09:08 +01:00
NEWS_ARTICLE_TYPE_MATCH = 0, /**< Article about a match. */
2008-11-27 14:24:18 +01:00
NEWS_ARTICLE_TYPE_FINANCES, /**< Article about user finances. */
NEWS_ARTICLE_TYPE_STAR_PLAYER_TRANSFER, /**< Article about good players appearing on the transfer list. */
NEWS_ARTICLE_TYPE_LEAGUE_CHAMPION, /**< Article about teams clinching the championship. */
NEWS_ARTICLE_TYPE_CUP_QUALIFICATION, /**< Article about teams clinching cup berths. */
NEWS_ARTICLE_TYPE_RELEGATION, /**< Article about teams getting relegated. */
NEWS_ARTICLE_TYPE_END
};
2008-11-28 15:09:08 +01:00
/** Structure containing a news title or subtitle with tokens. */
2008-11-27 14:24:18 +01:00
typedef struct
{
gchar *text;
/** Priority of the text (compared to
the other ones for the same article type).
The higher the priority the higher the
probability that the text gets picked. */
gint priority;
/** An id to keep track of already used texts
(so as not to use the same one too frequently). */
2008-12-01 21:39:16 +01:00
gint id;
/** A condition (if not fulfilled, the title or subtitle
doesn't get considered). */
gchar *condition;
2008-11-28 15:09:08 +01:00
2008-11-27 14:24:18 +01:00
} NewsText;
2008-11-28 15:09:08 +01:00
/** Structure describing a news paper article with tokens. */
2008-11-27 14:24:18 +01:00
typedef struct
{
/** Possible article titles (possibly containing tokens). */
GArray *titles;
/** Possible article subtitles (possibly containing tokens). */
GArray *subtitles;
/** A condition (if not fulfilled, the article doesn't get
shown). */
gchar *condition;
2008-12-07 12:28:18 +01:00
/** Priority of the article. */
gint priority;
2008-12-16 12:27:44 +01:00
/** An id to avoid repetitions. */
gint id;
2008-11-28 15:09:08 +01:00
2008-11-27 14:24:18 +01:00
} NewsArticle;
2008-11-28 15:09:08 +01:00
/** Structure holding an article without tokens (ie. the real deal that's displayed). */
typedef struct
{
gint week_number, week_round_number;
gint title_id, subtitle_id;
2008-12-26 16:59:46 +01:00
gint clid, cup_round;
gchar *title_small, *title, *subtitle;
2008-12-16 12:27:44 +01:00
gint id;
gint user_idx;
2008-11-28 15:09:08 +01:00
} NewsPaperArticle;
/** Structure holding the newspaper for the game. */
typedef struct
{
/** The array of created articles. */
GArray *articles;
} NewsPaper;
2008-11-27 14:24:18 +01:00
#endif