本文整理汇总了C#中QuestID类的典型用法代码示例。如果您正苦于以下问题:C# QuestID类的具体用法?C# QuestID怎么用?C# QuestID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QuestID类属于命名空间,在下文中一共展示了QuestID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetRequirementsStatus
/// <summary>
/// Sets whether or not we have the requirements for a quest.
/// </summary>
/// <param name="questID">The ID of the quest.</param>
/// <param name="hasRequirements">True if we have the requirements for the quest; false if we do not.</param>
public void SetRequirementsStatus(QuestID questID, bool hasRequirements)
{
if (!_statuses.ContainsKey(questID))
_statuses.Add(questID, hasRequirements);
else
_statuses[questID] = hasRequirements;
}
示例2: AcceptOrTurnInQuest
public static PacketWriter AcceptOrTurnInQuest(MapEntityIndex questProvider, QuestID questID)
{
var pw = GetWriter(ClientPacketID.AcceptOrTurnInQuest);
pw.Write(questProvider);
pw.Write(questID);
return pw;
}
示例3: AcceptOrTurnInQuestReply
public static PacketWriter AcceptOrTurnInQuestReply(QuestID questID, bool successful, bool accepted)
{
var pw = GetWriter(ServerPacketID.AcceptOrTurnInQuestReply);
pw.Write(questID);
pw.Write(successful);
pw.Write(accepted);
return pw;
}
示例4: Prepare
/// <summary>
/// Starts getting the status for the given <paramref name="quest"/> if the value is not already acquired.
/// </summary>
/// <param name="quest">The quest to get the status for.</param>
public void Prepare(QuestID quest)
{
if (_statuses.ContainsKey(quest))
return;
_statuses.Add(quest, null);
_sendRequest(quest);
}
示例5: GetDrawString
/// <summary>
/// Gets the string to draw for a list item.
/// </summary>
/// <param name="x">The item to draw.</param>
/// <returns>The string to draw for a list item.</returns>
static string GetDrawString(QuestID x)
{
var qdc = QuestDescriptionCollection.Create(ContentPaths.Dev);
var t = qdc[x];
if (t == null)
return x.ToString();
else
return t.QuestID + ". " + t.Name + " - " + t.Description;
}
示例6: addQuestState
/// <summary>
/// Adds the given state(s) to the quest with the given ID (keeping any old states)
/// </summary>
/// <param name="id">The particular quest</param>
/// <param name="state">The state(s) to add</param>
public static void addQuestState(QuestID id, QuestState state)
{
nullCheck();
triggers[(int)id] |= state;
//push event
QuestEventArgs args = new QuestEventArgs();
args.questID = id;
args.questStateChange = state;
args.add = true;
pushEvent(args);
}
示例7: HasRequirements
/// <summary>
/// Gets if the user has the requirements for the given quest.
/// </summary>
/// <param name="quest">The ID of the quest to check for the requirements of.</param>
/// <returns>True if the user has the requirements for the given <paramref name="quest"/>, false if they
/// do not have the requirements, or null if the status is currently unknown.</returns>
public bool? HasRequirements(QuestID quest)
{
bool? value;
// Try to get the cached value
if (!_statuses.TryGetValue(quest, out value))
{
// Value was not in the cache, so make the request, and return null for now
value = null;
Prepare(quest);
}
return value;
}
示例8: EditorQuest
/// <summary>
/// Initializes a new instance of the <see cref="EditorQuest"/> class.
/// </summary>
/// <param name="questID">The quest ID.</param>
/// <param name="dbController">The <see cref="IDbController"/>.</param>
/// <exception cref="ArgumentException">No quests for the given <paramref name="questID"/> exist.</exception>
public EditorQuest(QuestID questID, IDbController dbController)
{
_id = questID;
// Get the quest database table row
var questTable = dbController.GetQuery<SelectQuestQuery>().Execute(questID);
if (questTable == null)
{
const string errmsg = "Invalid QuestID ({0}) supplied - no quests with this ID exists.";
throw new ArgumentException(string.Format(errmsg, questID), "questID");
}
Debug.Assert(questID == questTable.ID);
// Get the quest description stuff from the client-side
var qd = _questDescriptions[ID];
if (qd != null)
{
Name = qd.Name;
Description = qd.Description;
}
else
{
Name = string.Empty;
Description = string.Empty;
}
// Get the quest details from the server side
RewardExp = questTable.RewardExp;
RewardCash = questTable.RewardCash;
Repeatable = questTable.Repeatable;
_startItems =
dbController.GetQuery<SelectQuestRequireStartItemQuery>().Execute(questID).Select(
x => new MutablePair<ItemTemplateID, byte>(x.ItemTemplateID, x.Amount)).ToList();
_finishItems =
dbController.GetQuery<SelectQuestRequireFinishItemQuery>().Execute(questID).Select(
x => new MutablePair<ItemTemplateID, byte>(x.ItemTemplateID, x.Amount)).ToList();
_startQuests = dbController.GetQuery<SelectQuestRequireStartCompleteQuestsQuery>().Execute(questID).ToList();
_finishQuests = dbController.GetQuery<SelectQuestRequireFinishCompleteQuestsQuery>().Execute(questID).ToList();
_rewardItems =
dbController.GetQuery<SelectQuestRewardItemQuery>().Execute(questID).Select(
x => new MutablePair<ItemTemplateID, byte>(x.ItemTemplateID, x.Amount)).ToList();
_kills =
dbController.GetQuery<SelectQuestRequireKillQuery>().Execute(questID).Select(
x => new MutablePair<CharacterTemplateID, ushort>(x.CharacterTemplateID, x.Amount)).ToList();
}
示例9: GetOrDefault
/// <summary>
/// Gets the <see cref="IQuestDescription"/> for a quest, or an empty description if the quest
/// description could not be found for the specified <paramref name="questID"/>.
/// </summary>
/// <param name="questID">The ID of the quest to get the <see cref="IQuestDescription"/> for.</param>
/// <returns>The <see cref="IQuestDescription"/> for a quest, or an empty description if the quest
/// description could not be found for the specified <paramref name="questID"/>.</returns>
public IQuestDescription GetOrDefault(QuestID questID)
{
var ret = this[questID];
if (ret == null)
{
return new QuestDescription
{
Name = "[Unknown Quest: " + questID + "]",
Description = "No description for this quest could be found.",
QuestID = questID
};
}
else
return ret;
}
示例10: CharacterQuestStatusKillsTable
/// <summary>
/// Initializes a new instance of the <see cref="CharacterQuestStatusKillsTable"/> class.
/// </summary>
/// <param name="characterID">The initial value for the corresponding property.</param>
/// <param name="characterTemplateID">The initial value for the corresponding property.</param>
/// <param name="count">The initial value for the corresponding property.</param>
/// <param name="questID">The initial value for the corresponding property.</param>
public CharacterQuestStatusKillsTable(CharacterID @characterID, CharacterTemplateID @characterTemplateID, UInt16 @count,
QuestID @questID)
{
CharacterID = @characterID;
CharacterTemplateID = @characterTemplateID;
Count = @count;
QuestID = @questID;
}
示例11: QuestRequireStartQuestTable
/// <summary>
/// Initializes a new instance of the <see cref="QuestRequireStartQuestTable"/> class.
/// </summary>
/// <param name="questID">The initial value for the corresponding property.</param>
/// <param name="reqQuestID">The initial value for the corresponding property.</param>
public QuestRequireStartQuestTable(QuestID @questID, QuestID @reqQuestID)
{
QuestID = @questID;
ReqQuestID = @reqQuestID;
}
示例12: EventCountersQuestTable
/// <summary>
/// Initializes a new instance of the <see cref="EventCountersQuestTable"/> class.
/// </summary>
/// <param name="counter">The initial value for the corresponding property.</param>
/// <param name="questEventCounterId">The initial value for the corresponding property.</param>
/// <param name="questID">The initial value for the corresponding property.</param>
public EventCountersQuestTable(Int64 @counter, Byte @questEventCounterId, QuestID @questID)
{
Counter = @counter;
QuestEventCounterId = @questEventCounterId;
QuestID = @questID;
}
示例13: HasQuestStartRequirements
public static PacketWriter HasQuestStartRequirements(QuestID questID, bool hasRequirements)
{
var ret = GetWriter(ServerPacketID.HasQuestStartRequirementsReply);
ret.Write(questID);
ret.Write(hasRequirements);
return ret;
}
示例14: OnCompletedQuestAdded
/// <summary>
/// When overridden in the derived class, allows for handling the
/// <see cref="UserQuestInformation.CompletedQuestAdded"/> event.
/// </summary>
/// <param name="questID">The ID of the quest that was added.</param>
protected override void OnCompletedQuestAdded(QuestID questID)
{
base.OnCompletedQuestAdded(questID);
UserInfo.HasStartQuestRequirements.Update(questID);
UserInfo.HasFinishQuestRequirements.SetRequirementsStatus(questID, false);
}
示例15: OnCompletedQuestAdded
/// <summary>
/// When overridden in the derived class, allows for handling the
/// <see cref="UserQuestInformation.CompletedQuestAdded"/> event.
/// </summary>
/// <param name="questID">The ID of the quest that was added.</param>
protected virtual void OnCompletedQuestAdded(QuestID questID)
{
}