ChessMng.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { _decorator } from "cc";
  2. import { room_type } from "../../constant";
  3. import { GameMng } from "../../GameMng";
  4. import { Singleton } from "../../gcommon/Singleton";
  5. const {ccclass, property} = _decorator;
  6. export const enum ChessType{
  7. renjiboyi,
  8. canju,
  9. haoyou,
  10. jifen,
  11. _null,
  12. }
  13. @ccclass
  14. export default class ChessMng extends Singleton<ChessMng>() {
  15. public chesstype:ChessType=ChessType._null;
  16. isTongqianRoom():boolean{
  17. if(GameMng._userData.room===null||GameMng._userData.room===undefined){
  18. return false;
  19. }
  20. if(GameMng._userData.room.roomtype==room_type._gaoji_tongqian||GameMng._userData.room.roomtype==room_type._chuji_tongqian||GameMng._userData.room.roomtype==room_type._zhongji_tongqian){
  21. return true;
  22. }
  23. return false;
  24. }
  25. isHaoyouRoom():boolean{
  26. if(GameMng._userData.room===null||GameMng._userData.room===undefined){
  27. return false;
  28. }
  29. if(GameMng._userData.room.roomtype==room_type._jing_dian_hao_you||GameMng._userData.room.roomtype==room_type._mei_miao_die_jia_hao_you){
  30. return true;
  31. }
  32. return false;
  33. }
  34. isJiFenRoom():boolean{
  35. if(GameMng._userData.room===null||GameMng._userData.room===undefined){
  36. return false;
  37. }
  38. if(GameMng._userData.room.roomtype==room_type._jifen_5||GameMng._userData.room.roomtype==room_type._jifen_10||GameMng._userData.room.roomtype==room_type._jifen_20){
  39. return true;
  40. }
  41. return false;
  42. }
  43. }