Documentation ¶
Index ¶
- Variables
- func AdjustmentStatus(v godip.Validator, me godip.Nation) (builds godip.Orders, disbands godip.Orders, balance int)
- func AnyMovePossible(v godip.Validator, typ godip.UnitType, src, dst godip.Province, ...) (dstCoast godip.Province, err error)
- func AnySupportPossible(v godip.Validator, typ godip.UnitType, src, dst godip.Province) (err error)
- func Build(source godip.Province, typ godip.UnitType, at time.Time) *build
- func BuildAnyHomeCenter(source godip.Province, typ godip.UnitType, at time.Time) *build
- func BuildAnywhere(source godip.Province, typ godip.UnitType, at time.Time) *build
- func Convoy(source, from, to godip.Province) *convoy
- func ConvoyEndPoints(v godip.Validator, startPoint godip.Province, reverse bool, ...) (result []godip.Province)
- func Disband(source godip.Province, at time.Time) *disband
- func HasEdge(v godip.Validator, typ godip.UnitType, src, dst godip.Province) bool
- func Hold(source godip.Province) *hold
- func HoldSupport(r godip.Resolver, prov godip.Province) int
- func Move(source, dest godip.Province) *move
- func MoveSupport(r godip.Resolver, src, dst godip.Province, forbiddenSupports []godip.Nation) int
- func MustConvoy(r godip.Resolver, src godip.Province) bool
- func PossibleMoves(v godip.Validator, src godip.Province, allowConvoy, dislodged bool) (result []godip.Province)
- func PossibleMovesUnit(v godip.Validator, unitType godip.UnitType, start godip.Province, reverse bool, ...) (result []godip.Province)
- func SupportHold(prov, target godip.Province) *support
- func SupportMove(prov, from, to godip.Province) *support
- type ConvoyPathFilter
- type ConvoyPathFinder
- type MultiError
- type Parser
- func (self Parser) OrderTypes() (result []godip.OrderType)
- func (self Parser) Orders() (result []godip.Order)
- func (self Parser) Parse(bits []string) (result godip.Adjudicator, err error)
- func (self Parser) ParseAll(orders map[godip.Nation]map[godip.Province][]string) (result map[godip.Province]godip.Adjudicator, err error)
Constants ¶
This section is empty.
Variables ¶
var BuildAnyHomeCenterOrder = &build{ flags: map[godip.Flag]bool{ godip.AnyHomeCenter: true, }, }
var BuildOrder = &build{}
var ConvoyOrder = &convoy{}
var DisbandOrder = &disband{}
var HoldOrder = &hold{}
var MoveOrder = &move{}
var SupportOrder = &support{}
Functions ¶
func AdjustmentStatus ¶
func AnyMovePossible ¶
func AnySupportPossible ¶
func BuildAnyHomeCenter ¶
func BuildAnywhere ¶
func ConvoyEndPoints ¶
func ConvoyEndPoints(v godip.Validator, startPoint godip.Province, reverse bool, noConvoy *godip.Province) (result []godip.Province)
ConvoyEndPoints returns all possible end points for a convoy route starting at startPoint. If reverse is false then the route will be for a unit moving from startPoint; if it's true then the route will be for a unit moving to startPoint instead. If noConvoy is set then the route cannot pass through it.
func HoldSupport ¶
HoldSupport returns successful supports of a hold in prov.
func MoveSupport ¶
MoveSupport returns the successful supports of movement from src to dst, discounting the nations in forbiddenSupports.
func MustConvoy ¶
MustConvoy returns whether the unit at src must convoy. Used during adjudication to find mandatory convoy path, i.e. if there is no other option, or there is a convoy option and the move is via convoy, or the owner has told at least one fleet to convoy the unit that way.
func PossibleMoves ¶
func PossibleMovesUnit ¶
func PossibleMovesUnit(v godip.Validator, unitType godip.UnitType, start godip.Province, reverse bool, allowConvoy bool, noConvoy *godip.Province) (result []godip.Province)
PossibleMovesUnit returns the possible provinces that a unit can move to or from. If reverse is false then the unit must be in start, and if true then the potential units must be able to move to start. Setting allowConvoy allows convoy routes to be considered, and these must avoid the province noConvoy (if given).
func SupportHold ¶
func SupportMove ¶
Types ¶
type ConvoyPathFilter ¶ added in v0.1.49
type ConvoyPathFilter struct { Validator godip.Validator Source godip.Province Destination godip.Province // If true, convoys will be resolved using Validator (cast to a Resolver) // to be considered OK. // Used during adjudication. ResolveConvoys bool // If true, destination will be checked the same way as every other step. // Used when validating convoy path _via_ provinces. DestinationMustConvoy bool // If not DestinationMustConvoy, i.e. destination is the landing point for the // convoyed unit, then the path up to the destination has to be at least // MinLengthAtDestination long for the step to destination to be OK. // Used to avoid finding convoy paths without any convoying fleets. MinLengthAtDestination int // If not nil, all fleets along the path have to be of this nation. // Used when warning about mismatched orders. OnlyNation *godip.Nation // If !ResolveConvoys, but VerifyConvoyOrderes, the participating fleets // need to at least give the convoy order to be considered OK. VerifyConvoyOrders bool // If set, this province will not be considered. // Used to find convoy paths not using a fleet attacked by someone supported // by the convoy target province, which is used to check if a support // is cut by the convoyed unit or not. AvoidProvince *godip.Province }
type ConvoyPathFinder ¶ added in v0.1.49
type ConvoyPathFinder struct { ConvoyPathFilter ViaNation *godip.Nation ViaProvince *godip.Province }
func (ConvoyPathFinder) Any ¶ added in v0.1.49
func (c ConvoyPathFinder) Any() []godip.Province
func (ConvoyPathFinder) Path ¶ added in v0.1.49
func (c ConvoyPathFinder) Path() []godip.Province
type MultiError ¶
type MultiError []error
func (MultiError) Error ¶
func (self MultiError) Error() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}