Britbot
Static Public Member Functions | Properties | Static Private Member Functions | Static Private Attributes
Britbot.Commander Class Reference

A top level manager that does the turn. More...

List of all members.

Static Public Member Functions

static Dictionary< Pirate,
Direction > 
Play (CancellationToken cancellationToken, out bool onTime)
 Makes a game move.
static int CalcMaxPrioritiesNum ()
 Max proirities we can afford to compute and iterate over.
static bool IsDefensive ()
 Checks if the Commander is in defensive or or offensive mode.

Properties

static List< GroupGroups [get, set]
 List of groups of our pirates.

Static Private Member Functions

static Commander ()
 This static constructor will run once and initialize the commander.
static void AllocateRevived ()
 Re-allocated revived pirates.
static void CalculateAndAssignTargets (CancellationToken cancellationToken)
 Assigns targets to each group based on pure magic Also initiate local scoring.
static double GlobalizeScore (SimulatedGame sg, Score[] scoreArr, CancellationToken cancellationToken)
 This function should convert an array of local scores into a numeric score based on global criteria.
static void MergeSimilar ()
 Merges similar groups.
static Dictionary< Pirate,
Direction > 
GetAllMoves (CancellationToken cancellationToken)
 Gets all th moves for each pirate in each group.
static Score[][] GetPossibleTargetMatrix ()
 This function goes over all the groups, reads their priorities and arranges them in a 2-dimensional array: Each group has it's own row which contains all its possible targets. Note: it is a jagged array and each group may have different number of targets. We use array because it has quick access property which we will use heavily.
static Score[] GetSpecificAssignmentScores (IReadOnlyList< Score[]> possibleAssignments, int[] assignment)
 Given all the possible assignments, and a specific assignment (given by array of indexes) returns the actual scores corresponding to this assignment.
static int[] GetTargetsDimensions ()
 Get the dimension vector which later will be used to create the iteration over all possible Group-Target assignments.
static void StartCalcPriorities (CancellationToken cancellationToken)
 this method forces all groups to calculate their priorities
static void FixGroupArrangement ()
 Moves pirates between groups if needed (physically)

Static Private Attributes

static Stopwatch _turnTimer
 Timer that keeps track on the time each turn takes.
static List< int > _deadPirates
 List of the dead pirates indexes.

Detailed Description

A top level manager that does the turn.

Definition at line 19 of file Commander.cs.


The documentation for this class was generated from the following file: