@@ -702,6 +702,42 @@ public List<Tile> GetTilesWithinRankDistance(int rank) {
702702 return result ;
703703 }
704704
705+ private List < Tile > _outerRing ;
706+
707+ public List < Tile > GetBFCOuterRing ( ) {
708+ if ( _outerRing != null )
709+ return _outerRing ;
710+
711+ // List of all the BFC tiles NOT including direct Neighbors
712+ // Essentially, this is every outer tile except North->North, South->South, West->West,East->East
713+ ( TileDirection direction1 , TileDirection direction2 ) [ ] outerRingDirections =
714+ {
715+ ( TileDirection . NORTHWEST , TileDirection . NORTH ) ,
716+ ( TileDirection . NORTHWEST , TileDirection . NORTHWEST ) ,
717+ ( TileDirection . NORTHWEST , TileDirection . WEST ) ,
718+ ( TileDirection . SOUTHWEST , TileDirection . WEST ) ,
719+ ( TileDirection . SOUTHWEST , TileDirection . SOUTHWEST ) ,
720+ ( TileDirection . SOUTHWEST , TileDirection . SOUTH ) ,
721+ ( TileDirection . SOUTHEAST , TileDirection . EAST ) ,
722+ ( TileDirection . SOUTHEAST , TileDirection . SOUTHEAST ) ,
723+ ( TileDirection . SOUTHEAST , TileDirection . SOUTH ) ,
724+ ( TileDirection . NORTHEAST , TileDirection . NORTH ) ,
725+ ( TileDirection . NORTHEAST , TileDirection . NORTHEAST ) ,
726+ ( TileDirection . NORTHEAST , TileDirection . EAST )
727+ } ;
728+
729+ Dictionary < ( TileDirection , TileDirection ) , Tile > outerRing = new Dictionary < ( TileDirection , TileDirection ) , Tile > ( ) ;
730+ foreach ( ( TileDirection dir1 , TileDirection dir2 ) directions in outerRingDirections ) {
731+ if ( ! neighbors . TryGetValue ( directions . dir1 , out var inner ) )
732+ continue ;
733+
734+ if ( inner != NONE && inner . neighbors . TryGetValue ( directions . dir2 , out var outer ) && outer != NONE )
735+ outerRing [ ( directions . dir1 , directions . dir2 ) ] = outer ;
736+ }
737+ _outerRing = outerRing . Values . ToList ( ) ;
738+ return _outerRing ;
739+ }
740+
705741 public MapUnit FindTopDefender ( MapUnit opponent ) {
706742 if ( unitsOnTile . Count > 0 ) {
707743 IEnumerable < MapUnit > potentialDefenders = unitsOnTile . Where ( u => u . CanDefendAgainst ( opponent ) ) ;
0 commit comments