초기커밋
This commit is contained in:
104
ServerCommon/Helper/QuestHelper.cs
Normal file
104
ServerCommon/Helper/QuestHelper.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using UGQDatabase.Models;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public static class QuestHelper
|
||||
{
|
||||
|
||||
public static (UInt32, UInt32) convertUgqQuestIdToQuestIdAndRevision(Int64 ugq_quest_id)
|
||||
{
|
||||
var quest_id = (UInt32)(ugq_quest_id & 0xFFFFFFFF);
|
||||
var quest_revision = (UInt32)(ugq_quest_id >> 32);
|
||||
return (quest_id, quest_revision);
|
||||
}
|
||||
|
||||
public static Int64 convertQuestIdAndRevisionToUgqQuestId(UInt32 quest_id, UInt32 quest_revision)
|
||||
{
|
||||
Int64 ugq_quest_id = ((Int64)quest_revision << 32) | quest_id;
|
||||
return ugq_quest_id;
|
||||
}
|
||||
|
||||
public static UgqStateType convertQuestContentStateToUgqStateType(QuestContentState state)
|
||||
{
|
||||
|
||||
//RevisionChanged 이건 어디다 쓰지?
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case QuestContentState.None:
|
||||
case QuestContentState.Editable:
|
||||
case QuestContentState.Shutdown:
|
||||
case QuestContentState.Standby:
|
||||
return UgqStateType.Shutdown;
|
||||
case QuestContentState.Test:
|
||||
return UgqStateType.Test;
|
||||
case QuestContentState.Live:
|
||||
return UgqStateType.Live;
|
||||
default:
|
||||
return UgqStateType.Shutdown;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static QuestContentState convertUgqStateTypeToQuestContentState(UgqStateType state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case UgqStateType.Test:
|
||||
return QuestContentState.Test;
|
||||
case UgqStateType.Live:
|
||||
return QuestContentState.Live;
|
||||
case UgqStateType.Shutdown:
|
||||
case UgqStateType.None:
|
||||
return QuestContentState.None;
|
||||
default:
|
||||
return QuestContentState.None;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string convertUgqGradeToQuestCheckGrade(UgqGradeType gradeType)
|
||||
{
|
||||
switch (gradeType)
|
||||
{
|
||||
case UgqGradeType.Amature:
|
||||
return QuestUgqGradeConditionType.AMATEUR.ToString();
|
||||
case UgqGradeType.RisingStar:
|
||||
return QuestUgqGradeConditionType.RISINGSTAR.ToString();
|
||||
case UgqGradeType.Master1:
|
||||
return QuestUgqGradeConditionType.MASTER1.ToString();
|
||||
case UgqGradeType.Master2:
|
||||
return QuestUgqGradeConditionType.MASTER2.ToString();
|
||||
case UgqGradeType.Master3:
|
||||
return QuestUgqGradeConditionType.MASTER3.ToString();
|
||||
case UgqGradeType.None:
|
||||
return QuestUgqGradeConditionType.ALL.ToString();
|
||||
default:
|
||||
return QuestUgqGradeConditionType.ALL.ToString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum QuestUgqGradeConditionType
|
||||
{
|
||||
ALL = 1,
|
||||
AMATEUR = 2,
|
||||
RISINGSTAR = 3,
|
||||
MASTER1 = 4,
|
||||
MASTER2 = 5,
|
||||
MASTER3 = 6,
|
||||
}
|
||||
Reference in New Issue
Block a user