public Board(string[] board, CharacterSymbols characterPiece, CharacterSymbols targetPiece, ISymbolActionStrategy actionStrategy) { CharacterPiece = characterPiece; TargetPiece = targetPiece; _actionStrategy = actionStrategy; //this is null Details = new CharacterSymbols[board.Length][]; var targetCount = 0; for (var r = 0; r < board.Length; r++) { for (var c = 0; c < board.Length; c++) { switch ((int)board[r][c]) { case (int)CharacterSymbols.Target: Details[r][c] = CharacterSymbols.Target; break; case (int)CharacterSymbols.Bot: Details[r][c] = CharacterSymbols.Bot; break; case (int)CharacterSymbols.Empty: Details[r][c] = CharacterSymbols.Empty; break; default: throw new Exception("Invalid character on board."); } if (Details[r][c] == targetPiece) { targetCount++; } } } CalculatedDefaultCellScore = (100 * targetCount) * .1; ScoreRadiationThreshold = Math.Sqrt(CalculatedDefaultCellScore) * .01; Metadata = BuildMetadata(); RegisterCellRelationshipEvents(); }
public NpcCharacter(CharacterSymbols characterSymbol, Action <IPlayableLocation> action) : base(characterSymbol) { _action = action; }
public PlayableCharacter(CharacterSymbols characterSymbol, Action <IPlayableLocation> action, Func <IPlayableLocation, IPlayableLocation> moveStrategy) : base(characterSymbol) { _action = action; _moveStrategy = moveStrategy; }
protected Character(CharacterSymbols characterSymbol) { CharacterSymbol = characterSymbol; }