Package net.sf.freecol.common.model
FreeCol Game Model package
This package contains the game model, which describes how the
individual game objects, such as units, buildings, tiles and so on,
interact. The model is extended by the server and used by the client.
It should be independent of all packages outside of
the common
hierarchy.
The superclass of most model objects is FreeColObject
, which
provides serialization. The FreeColObject
is identified
by an ID, which is generally unique. The Feature
class
and its descendants is a notable exception to this rule,
however, since Features with similar effects are provided by
various model objects and are grouped by their ID. A fur production
bonus, for example, might be granted by a Tile Type, a Unit Type
and a Founding Father.
The main model objects inherit from the FreeColGameObject
, which contains a reference to the Game
class. Many model objects have a type
, which
inherits from the FreeColGameObject
.
Units have a UnitType, for
example. These Game Object Types are defined by the Specification
, which
is loaded from an XML file when the game starts up.
- Since:
- 0.2.1
-
Interface Summary Interface Description BaseProduction The BaseProduction interface eliminates duplicate code inBuildingType
andTileType
as theBaseProduction.getBaseProduction(ProductionType, GoodsType, UnitType)
method originally was identical methods in seperate classesConstants Contains the constants.Consumer Objects implementing the Consumer interface consume Goods.FreeColGameObjectListener Interface for retriving information about a the creation/deletion ofFreeColGameObject
s.Locatable An object that can be put in aLocation
.Location A place where aLocatable
can be put.Map.SearchHeuristic Simple interface to supply a heuristic to the A* routine.Movable An object that can move from one Location to another under its own power.Nameable An object with a name that can be changed.Named An object that has a name.Ownable Interface for objects which can be owned by aPlayer
.Specification.ChildReader TradeLocation A wrapper interface for a location that can be on a trade route.TransactionListener Interface for classes which listen to transactions in market -
Class Summary Class Description Ability TheAbility
class encapsulates a bonus or penalty that can be applied to any action within the game, most obviously combat.AbstractGoods Represents a certain amount of a GoodsType.AbstractUnit Contains the information necessary to create a new unit.BuildableType Contains information on buildable types.Building Represents a building in a colony.BuildingType Encapsulates data common to all instances of a particular kind ofBuilding
, such as the number of workplaces, and the types of goods it produces and consumes.BuildQueue<T extends BuildableType> A queue of things for a colony to build.Colony Represents a colony.Colony.TileImprovementSuggestion Container class for tile exploration or improvement suggestions.ColonyTile Represents a work location on a tile.ColonyTradeItem A trade item consisting of a colony.ColonyWas Helper container to remember a colony state prior to some change, and fire off any consequent property changes.CombatModel A abstract requirements for a FreeCol combat model.CombatModel.CombatOdds Odds a particular outcome will occur in combat.DiplomaticTrade The classDiplomaticTrade
represents an offer one player can make another.Disaster This class describes disasters that can happen to a Colony, such as flooding, disease or Indian raids.Effect The effect of a natural disaster or other event.Europe Represents Europe in the game.EuropeanNationType Represents one of the European nations present in the game, i.e.EuropeWas Helper container to remember the Europe state prior to some change, and fire off any consequent property changes.Event A special game event.ExportData Objects of this class hold the export data for a particular type of goods.Feature TheFeature
class encapsulates a bonus or penalty that can be applied to any action within the game, most obviously combat.FeatureContainer A container to hold abilities and modifiers for some FreeColObject-subclass.Force A group of units with a common origin and purpose.FoundingFather Represents one FoundingFather to be contained in a Player object.FreeColGameObject The superclass of all game objects in FreeCol.FreeColObject The FreeCol root class.FreeColSpecObject A FreeColObject that also contains a Specification.FreeColSpecObjectType The base class for all types defined by the specification.Game The main component of the game model.GoldTradeItem A trade item consisting of just some gold.Goods Represents locatable goods of a specified type and amount.GoodsContainer Contains goods and can be used by aLocation
to make certain tasks easier.GoodsLocation GoodsTradeItem A trade item consisting of some goods.GoodsType A type of goods, derived from the specification.HighScore A FreeCol high score record.HighSeas An object representing the high seas between continents.HistoryEvent A notable event in the history of a game.InciteTradeItem A trade item consisting of a player to incite war against.IndianNationType Represents one of the native nations present in the game.IndianSettlement Represents an Indian settlement.LandMap A class to encapsulate a binary land map.LastSale This class contains the last sale a player has made, by Settlement and GoodsType.Limit TheLimit
class encapsulates a limit on the availability of FreeColObjects.LostCityRumour Represents a lost city rumour.Map A rectangular isometric map.Map.MoveCandidate Internal class for evaluating a candidate move.Map.Position A position on the Map.Market This class implements a simple economic model where a market holds all goods to be sold and the price of a particular goods type is determined solely by its availability in that market.MarketData Objects of this class hold the market data for a particular type of goods.MarketWas Helper container to remember the Market state prior to some change, and fire off any consequent property changes.ModelMessage Contains a message about a change in the model.Modifier TheModifier
class encapsulates a bonus or penalty that can be applied to any action within the game, most obviously combat.Monarch This class implements the player's monarch, whose functions prior to the revolution include raising taxes, declaring war on other European countries, and occasionally providing military support.Nation Represents one of the nations present in the game.NationOptions The options specific to a nation.NationSummary A container class summarizing an enemy nation.NationType Represents the type of one of the nations present in the game.NativeTrade Container class for the information that persists while a native trade session is underway.NativeTradeItem A trade item consisting of some goods to be traded with the natives.Occupation Simple container to define where and what a unit is working on.Operand TheOperand
class implements Operands to be used in relations, such as the Limit class.PathNode Represents a singleLocation
in a path.Player Represents a player.PlunderType The plunder available from a settlement.ProductionCache TheProductionCache
is contains all relevant information about the production and consumption of the colony.ProductionInfo Container for information about production in a colony.ProductionMap A map of goods types and their production.ProductionMap.ProductionTree ProductionType This class describes a possible production type of a tile or building.RandomRange A range of numbers, and support routines to make a random choice therefrom.Region A named region on the map.Resource Represents a production resource, such as prime tobacco, or an ore vein, located on a Tile.ResourceType The types of resources (e.g.Role The role of a unit.Role.RoleChange Container for valid role changes.Scope TheScope
class determines whether a givenFreeColSpecObjectType
fulfills certain requirements.ScopeContainer How scopes are handled.Settlement The super class of all settlements on the map (that is colonies and indian settlements).SettlementType The various types of settlements in the game.SimpleCombatModel This class implements the original Colonization combat model.Specification This class encapsulates any parts of the "specification" for FreeCol that are expressed best using XML.Specification.Source Sources.StanceTradeItem A trade item consisting of a change of stance.StringTemplate TheStringTemplate
represents a non-localized string that can be localized by looking up its value in a message bundle or similar Map.Tension A measure of the tension between nations.Tile Represents a single tile on theMap
.Tile.IndianSettlementInternals Information that is internal to the native settlements, and only updated on close contact.TileImprovement Represents a tile improvement, such as a river or road.TileImprovementStyle Represents the style of a tile improvement, such as a river or road.TileImprovementType An improvement to make to a tile.TileItem Represents aTileItem
item on aTile
.TileItemContainer ContainsTileItem
s and can be used by aTile
to make certain tasks easier.TileType The types of tiles.TileTypeChange A change in a tile type, including some bonus production when this occurs.TradeItem One of the items a DiplomaticTrade consists of.TradeRoute A TradeRoute holds all information for a unit to follow along a trade route.TradeRouteStop A stop along a trade route.Turn Represents a given turn in the game.TypeCountMap<T extends FreeColSpecObjectType> A map that incorporates a count.Unit Represents all pieces that can be moved on the map-board.Unit.ClosestSettlementGoalDecider UnitChangeType The possible changes of a unit type.UnitIterator AnIterator
ofUnit
s that can be made active.UnitLocation TheUnitLocation
is a place where aUnit
can be put.UnitTradeItem A trade item consisting of a unit.UnitType The various types of units in FreeCol.UnitTypeChange Simple container for individual type changes.UnitWas Helper container to remember a unit state prior to some change, and fire off any consequent property changes.WorkLocation WorkLocation.Suggestion Container class to suggest a better use of a unit. -
Enum Summary Enum Description BuildQueue.CompletionAction Colony.ColonyChangeEvent Colony.NoBuildReason Reasons for not building a buildable.CombatModel.CombatResult Constants.ArmedUnitSettlementAction Actions when an armed unit contacts a settlement.Constants.BoycottAction Actions when dealing with a boycott.Constants.ClaimAction Actions when claiming land.Constants.IndianDemandAction Actions surrounding native demands at colonies.Constants.IntegrityType The result of checkIntegrity.Constants.MissionaryAction Actions with a missionary at a native settlement.Constants.ScoutColonyAction Actions in scouting a colony.Constants.ScoutIndianSettlementAction Actions in scouting a native settlement.Constants.TradeAction Choice of sales action at a native settlement.Constants.TradeBuyAction Actions when buying from the natives.Constants.TradeSellAction Actions when selling to the natives.DiplomaticTrade.TradeContext A context for the trade.DiplomaticTrade.TradeStatus A type for the trade status.Direction The directions a Unit can move to.Disaster.Effects Whether to apply one, many or all applicable disasters.Europe.MigrationType Migration handling.FoundingFather.FoundingFatherType Game.FcgoState State for the FCGO iterator, out here because it has to be static.Game.LogoutReason Reasons for logging out.HighScore.ScoreLevel On retirement, an object will be named in honour of the player.HistoryEvent.HistoryEventType IndianSettlement.ContactLevel The level of contact between a player and this settlement.Limit.Operator The basic operation used in evaluating this limit.LostCityRumour.RumourType Constants describing types of Lost City Rumours.Map.Layer The layers included in the map.Map.MoveStep Possible actions by the unit travelling along a path in consideration of the next tile.Market.Access Constant for specifying the access to thisMarket
when selling goods.ModelMessage.MessageType Constants categorizing the type of message.Modifier.ModifierType Monarch.MonarchAction Constants describing monarch actions.NationOptions.Advantages Type of national advantages for European players.NationOptions.NationState Nations may be available to all players, to AI players only, or to no players.NationType.AggressionLevel NationType.SettlementNumber NativeTrade.NativeTradeAction The type of native trade command.Operand.OperandType Operand.ScopeLevel Player.ColonyValueCategory Colony value categories.Player.NoClaimReason A variety of reasons why a tile can not be claimed, either to found a settlement or just to be used by one, including the double negative NONE == "no reason" case.Player.NoValueType Special return values for showstopper getColonyValue fail.Player.PlayerType Types of players.Region.RegionType The type of region.Stance The stance one player has towards another player.StringTemplate.TemplateType The type of this StringTemplate, either NAME, a proper name that must not be localized (e.g.Tension.Level Constants for describing alarm levels.TileType.RangeType Unit.MoveType A move type.Unit.PortMode Internal state for findIntermediatePort.Unit.UnitLabelType What type of unit label do we want?Unit.UnitState A state a Unit can have.UnitLocation.NoAddReason