1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2024-12-17 18:59:10 +01:00
bygfoot/src/strategy_struct.h

85 lines
2.5 KiB
C
Raw Normal View History

2005-10-24 22:50:48 +02:00
/*
2005-11-26 17:52:51 +01:00
strategy_struct.h
2005-10-24 22:50:48 +02:00
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 STRATEGY_STRUCT_H
#define STRATEGY_STRUCT_H
/** Lineup types for a CPU team (ie. which players
are preferred when putting together the first 11). */
enum StratLineupType
{
2005-10-27 23:10:15 +02:00
STRAT_LINEUP_BEST = 1,
2005-10-24 22:50:48 +02:00
STRAT_LINEUP_WEAKEST,
STRAT_LINEUP_FITTEST,
STRAT_LINEUP_UNFITTEST,
STRAT_LINEUP_END
};
/** A struct describing the pre-match strategy settings
of a CPU team. */
typedef struct
{
/** A condition describing when the strategy should be applied. */
gchar *condition;
/** Array of possible formations, sorted by preference. */
GArray *formations;
/** Boost, style values and lineup type. */
gint boost, style, lineup;
/** The fitness value below which a player gets substituted
if there's a sub with better fitness. */
gfloat min_fitness;
} StrategyPrematch;
typedef struct
{
/** A condition describing when the action should be taken. */
2005-10-27 23:10:15 +02:00
gchar *condition, *sub_condition;
2005-10-24 22:50:48 +02:00
/** New boost and style values. */
gint boost, style;
/** Substitution specifiers (position and property).
Property is taken from #StratLineupType. */
gint sub_in_pos, sub_in_prop,
sub_out_pos, sub_out_prop;
2005-10-27 23:10:15 +02:00
/** An id to prevent actions from being applied again and
again during a match. */
gint id;
2005-10-24 22:50:48 +02:00
} StrategyMatchAction;
/** A CPU strategy. */
typedef struct
{
/** String id and description of the strategy. */
gchar *sid, *desc;
/** How often this strategy gets picked, relative
to the other strategies. */
gint priority;
/** Array with prematch settings. */
GArray *prematch;
/** Array with match settings. */
GArray *match_action;
} Strategy;
#endif