Пример #1
0
 public static Tile Create(int r,int c,int elev)
 {
     if(M.tile[r,c] == null){
         Tile t = new Tile();
         t.elevation = elev;
         t.p = new pos(r,c);
         M.tile[r,c] = t;
         return t;
     }
     return null;
 }
Пример #2
0
 public int ElevationDifference(Tile other)
 {
     return Math.Abs(elevation - other.elevation);
 }
Пример #3
0
 public static List<Tile> BlockingTiles(Tile blocked)
 {
     List<Tile> result = new List<Tile>();
     int threshold = blocked.elevation * G.elevation_px;
     pos p = M.GetDrawingPosition(blocked);
     Tile current = blocked;
     while(current != null){
         Tile other = current.TileInDirection(G.TrueDirectionFromScreenDirection(2));
         if(other != null && other.elevation * G.elevation_px > threshold){
             result.Add(other);
         }
         other = current.TileInDirection(G.TrueDirectionFromScreenDirection(6));
         if(other != null && other.elevation * G.elevation_px > threshold){
             result.Add(other);
         }
         p = new pos(p.row+1,p.col+1);
         current = M.TileFromDrawingPosition(p);
         if(current != null && current.elevation * G.elevation_px > threshold){
             result.Add(current);
         }
         threshold += G.tile_h;
     }
     return result;
 }
Пример #4
0
 public AI_Action(Tile t_,Tile t2_,TargetResult effect_)
 {
     t = t_;
     t2 = t2_;
     effect = effect_;
 }