Ejemplo n.º 1
0
    //比较
    public static int MissionCompare(PetMissionData a, PetMissionData b)
    {
        var state1 = (PetMissionStateType)a.State;
        var state2 = (PetMissionStateType)b.State;

        if (state1 == PetMissionStateType.Finish)
        {
            return(-1);
        }
        if (state2 == PetMissionStateType.Finish)
        {
            return(1);
        }

        var t1 = Extension.FromServerBinary(a.OverTime);
        var t2 = Extension.FromServerBinary(b.OverTime);

        if (t1 < t2)
        {
            return(-1);
        }
        return(1);

        return(0);
    }
Ejemplo n.º 2
0
    //设置任务数据
    public bool SetPetMission(int missionId, PetMissionData data)
    {
        var PetMissionDataListCount0 = PetMissionDataList.Count;

        for (var i = 0; i < PetMissionDataListCount0; i++)
        {
            if (PetMissionDataList[i].Id == missionId)
            {
                PetMissionDataList[i] = data;
                return(true);
            }
        }


        return(false);
    }