示例#1
0
    public static void CMD_SITDOWN(NetworkMsg msg)
    {
        SitDown xmsg = new SitDown();

        using (MemoryStream stream = new MemoryStream(msg.data))
        {
            xmsg = ProtoBuf.Serializer.Deserialize <SitDown>(stream);
        }

        List <bool>   wxLogin = xmsg.wxLogin;
        List <string> wxHead  = xmsg.wxHead;

        for (int i = 0; i < xmsg.m_iPlayerCount; i++)
        {
            Battle_wxLogin[i] = wxLogin[i];
            if (wxLogin[i] == true)
            {
                Battle_wxHead[i] = wxHead[i];
            }
        }

        CMD_MAP_MATCH_result = (int)ResultID.result_id_success;
        if (CMD_MAP_MATCH_result == (int)ResultID.result_id_success)
        {
            gameInfo_sitdown = xmsg;
            EventDispatcher.DispatchEvent("EventShowPrepareUI", null, null);
        }
        Network.seat = xmsg.m_cSeatID;
    }
示例#2
0
    /// <summary>
    /// 二次匹配初始化
    /// </summary>
    public static void Init()
    {
        CMD_MAP_MATCH_result = -1;
        role_res             = -1;
        seat_res             = 0;
        seat_binary          = 0;

        gameInfo         = new Res_merge();
        gameInfo_sitdown = new SitDown();
        battleinfo       = new BattleInfo();

        playerid2 = 0;
        Round     = 1;
        PreMove   = 0;
        Pid_Tid   = new Dictionary <int, int>();

        Attacking = 0;
        Moving    = false;

        GameChooseStatus = -1;

        GameLoading     = 0;
        GameLoading_Cnt = 0;
        for (int i = 1; i <= 10; i++)
        {
            GameLoading_num[i] = 0;
            GameChoose_num[i]  = 0;
        }

        for (int i = 0; i < 20; i++)
        {
            Skill_CD[i] = 0;
        }
    }
示例#3
0
    public void SetUpActions()
    {
        actions.Clear();

        for (int i = 0; i < noOfActions; i++)
        {
            ActionTypes actionType = (ActionTypes)Random.Range(0, Action.noOfActionTypes);
            Action      action     = null;

            switch (actionType)
            {
            case ActionTypes.DrinkWater:
                action = new DrinkWater();
                break;

            case ActionTypes.SitDown:
                action = new SitDown();
                break;

            case ActionTypes.Exit:
                action = new SitDown();
                break;

            case ActionTypes.UseCashier:
                action = new UseCashier();
                break;

            case ActionTypes.StartAttack:
                action = new SitDown();
                break;

            default:
                break;
            }

            action.SetActionTaker(this);
            actions.Add(action);
        }

        Action exitAction = new ExitAction();

        exitAction.SetActionTaker(this);
        actions.Add(exitAction);

        currActionIndex = 0;
    }