position.dart 379 B

12345678910111213
  1. import 'package:gobang/bridge/chess_shape.dart';
  2. import 'package:gobang/flyweight/chess.dart';
  3. /// 棋子位置;颜色由享元 [Chess] 共享,形状为外部状态。
  4. class Position {
  5. double dx;
  6. double dy;
  7. Chess chess;
  8. ChessShape chessShape;
  9. Position(this.dx, this.dy, this.chess, {ChessShape? chessShape})
  10. : chessShape = chessShape ?? chess.chessShape;
  11. }