block_info.dart 721 B

123456789101112131415161718192021222324252627282930313233343536
  1. /// Description: 方块信息
  2. /// Time : 05/01/2023 Monday
  3. /// Author : liuyuqi.gov@msn.cn
  4. class BlockInfo {
  5. /// 构造函数
  6. /// value: 值
  7. /// current: 当前位置
  8. /// before: 上一个位置
  9. /// myis: 是否是自己
  10. BlockInfo(
  11. {required this.value,
  12. required this.current,
  13. required this.before,
  14. this.myis = true}) {
  15. if (this.before == null) {
  16. this.before = this.current;
  17. } else {
  18. this.before = this.before;
  19. }
  20. }
  21. int value;
  22. int current;
  23. int before;
  24. bool needMove = false;
  25. bool needCombine = false;
  26. bool myis = false;
  27. /// 重置
  28. void reset() {
  29. value = 0;
  30. needMove = false;
  31. needCombine = false;
  32. myis = false;
  33. }
  34. }