Esempio n. 1
0
    //-------------------------一些接口--------------------------------------------------------
    PlayerScore createPlayerScore(int index, CommonDefine.eCreateRoomType roomType,
                                  GameEvent.sV2V_ShowGameResult.sGameResult rst)
    {
        PlayerScore playerScore = Instantiate(_playerScorePrefab, new Vector3(0, 0, 0), Quaternion.identity);

        playerScore.transform.SetParent(_playerContainer.transform);

        playerScore.transform.localPosition = new Vector3(0, 150 - index * 100, 0);

        bool self      = CommonUtil.Util.getLocalBySeat(rst.seat) == (int)CommonDefine.SEAT.SELF;
        bool showOwner = false;

        if (roomType == CommonDefine.eCreateRoomType.ROOM_ROOM ||
            roomType == CommonDefine.eCreateRoomType.ROOM_TEAM)
        {
            if (rst.isOwner)
            {
                showOwner = true;
            }
            else
            {
                showOwner = false;
            }
        }

        playerScore.updatePlayScore(self, index + 1, rst.seat, showOwner, rst.head, rst.name,
                                    rst.area, rst.kill, rst.score, rst.multi, rst.hasAbandon);

        playerScore.transform.localScale = playerScore.transform.localScale * CommonUtil.Util.getScreenScale();

        return(playerScore);
    }
Esempio n. 2
0
        public static string getModeStr(CommonDefine.eCreateRoomType type, int playerNum, int gridLevel)
        {
            string mode = "";

            if (type != CommonDefine.eCreateRoomType.ROOM_CLASSIC_PLAZA)
            {
                if (playerNum == 2)
                {
                    mode = mode + "双人";
                }
                else if (playerNum == 3)
                {
                    mode = mode + "三人";
                }
                else if (playerNum == 4)
                {
                    mode = mode + "四人";
                }
                if (gridLevel == 4)
                {
                    mode = mode + "四阶";
                }
                else if (gridLevel == 6)
                {
                    mode = mode + "六阶";
                }
                else if (gridLevel == 8)
                {
                    mode = mode + "八阶";
                }
            }
            else
            {
                if (playerNum == 2 && gridLevel == 4)
                {
                    mode = "楚汉逐鹿";
                }
                else if (playerNum == 2 && gridLevel == 6)
                {
                    mode = "一决雌雄";
                }
                else if (playerNum == 4 && gridLevel == 6)
                {
                    mode = "四国混战";
                }
                else if (playerNum == 3 && gridLevel == 6)
                {
                    mode = "三足鼎立";
                }
            }

            return(mode);
        }
Esempio n. 3
0
        public static void setRoomData(int roomid, int levelId, int plazaID, int roomtype, int roomOwner, string ruleStr, int bs)
        {
            roomID    = roomid;
            rule      = ruleStr;
            roomLevel = levelId;
            owner     = roomOwner;

            roomRule = CommonUtil.RoomRule.deserialize(ruleStr);
            roomType = (CommonDefine.eCreateRoomType)roomtype;
            plazaid  = plazaID;
            //其他参数
            baseScore = bs;
        }
Esempio n. 4
0
        public static List <RoomData> roomList = new List <RoomData>(); //此条不随具体对局变化,是静态数据,只有再次收到才清空

        public static void reset()
        {
            roomType  = CommonDefine.eCreateRoomType.ROOM_CLASSIC_PLAZA;
            plazaid   = 0;
            plazaName = "";
            tagId     = -1;
            roomLevel = 0;
            owner     = 0;
            roomID    = 0;
            rule      = "";
            //roomRule.playerNum = 0;
            playerList.Clear();
            selfSeat   = 255;
            isRelink   = false;
            baseScore  = 0;
            hasAbandon = false;

            Account.inRoomId = 0;            //清除
        }