import 'package:gobang/models/chess.dart'; import 'package:gobang/models/chess_shape.dart'; /// 棋子位置;颜色由享元 [Chess] 共享,形状与坐标为外部状态。 class Position { double dx; double dy; int gridX; int gridY; Chess chess; ChessShape chessShape; Position( this.dx, this.dy, this.chess, { this.gridX = 0, this.gridY = 0, ChessShape? chessShape, }) : chessShape = chessShape ?? chess.chessShape; }