本文整理汇总了C#中Quest类的典型用法代码示例。如果您正苦于以下问题:C# Quest类的具体用法?C# Quest怎么用?C# Quest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Quest类属于命名空间,在下文中一共展示了Quest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
//Инициализация задания
public void Init(Quest parentQuest)
{
_parentQuest = parentQuest;
//Если задание было загружено с диска, то необходима проверка на его завершенность. Если задание завешенное, то вызываем событие о выполнение данного задания.
if (_taskTargetsAmountCounter >= _taskTargetsAmount && TaskTargetsAmount > 0)
{
_status = true;
_taskTargetsAmountCounter = _taskTargetsAmount;
_parentQuest.OnTaskChange();
return;
}
switch(EventType)
{
case "UnitDied":
EventHub<EntityDiedEventArgs>.EventHappened += OnEventDiedHandler;
break;
case "ItemPicked":
EventHub<EntityItemPickedUpEventArgs>.EventHappened += OnEventPick;
break;
case "PositionMoved":
EventHub<EntityIsCloseToPlayer>.EventHappened += OnPositionMoved;
break;
}
}
示例2: LoadQuests
public List<Quest> LoadQuests()
{
if (PlayerPrefs.HasKey("PlayerQuests")) {
_quest = new Quest (null, null, null, -1, null);
List<Quest> quests = new List<Quest> ();
JSONNode loadedQuests = JSONClass.Parse (PlayerPrefs.GetString ("PlayerQuests"));
for (int i = 0; i < loadedQuests["Quests"].Count; i++) {
int[] progress = new int[loadedQuests ["Quests"] [i].Count];
for (int j = 0; j < loadedQuests["Quests"][i].Count; j++) {
progress [j] = loadedQuests ["Quests"] [i] [j].AsInt;
}
Quest newQuest = _quest.AddQuestFromSave (loadedQuests ["Quests"] [i].AsInt, progress);
quests.Add (newQuest);
}
return quests;
}
return null;
}
示例3: Initialize
public void Initialize(Quest quest)
{
if(objectivesHeader != null)
{
objectivesHeader.text = "OBJECTIVES";
}
if(questName != null)
{
questName.text = quest.questName.ToUpper();
}
if(description != null)
{
description.text = quest.description;
}
// Destroy all children
for (int i = 0; i < objectivesListTransform.childCount; i++)
{
Destroy(objectivesListTransform.GetChild(i).gameObject);
}
// Add objectives to list
foreach (Objective obj in quest.objectives)
{
ObjectiveDisplay display = Instantiate(objectiveDisplayPrefab) as ObjectiveDisplay;
display.transform.SetParent(objectivesListTransform, false);
display.Initialize(obj);
}
}
示例4: Start
public void Start()
{
Quest q = new Quest("Q01");
q.title = "Carte SD de AI";
q.objective = "AI a perdu des documents précieux. Je dois retrouver la carte SD.";
quests.Add(q);
}
示例5: Start
void Start()
{
shoot_first = new Quest();
Objective first_objective = new EliminationObjective("Hover Droid", 3);
shoot_first.objectives.Add(first_objective);
shoot_first.startQuest();
}
示例6: QuestDetailsScreen
/// <summary>
/// Creates a new QuestDetailsScreen object.
/// </summary>
public QuestDetailsScreen(Quest quest)
: base()
{
// check the parameter
if (quest == null)
{
throw new ArgumentNullException("quest");
}
if (quest.AssetName.Contains("SaveMercadia") && !AudioManager.TitlePlayed)
{
AudioManager.TitlePlayed = false;
//TEMP COMMENT
//AudioManager.PlaySong(quest.AssetName.Replace("Quests\\", "") + "Begin");
}
this.quest = quest;
this.IsPopup = true;
currentDialogue = new List<Line>();
maxLines = 13;
textPosition.X = 261f;
quest.Name = CheckAdult.parseContent(quest.Name);
quest.Description = CheckAdult.parseContent(quest.Description);
quest.ObjectiveMessage = CheckAdult.parseContent(quest.ObjectiveMessage);
quest.CompletionMessage = CheckAdult.parseContent(quest.CompletionMessage);
AddStrings(this.quest.Name,
Fonts.BreakTextIntoList(this.quest.Description,
Fonts.DescriptionFont, 715), GetRequirements(this.quest));
}
示例7: QuestRealtimeProgressViewModel
public QuestRealtimeProgressViewModel(Quest rpQuest)
{
r_Quest = rpQuest;
DecreaseCommand = new DelegatedCommand(Decrease, CanDecrease);
IncreaseCommand = new DelegatedCommand(Increase, CanIncrease);
}
示例8: tsbRefresh_Click
private void tsbRefresh_Click(object sender, EventArgs e) {
lvl.Items.Clear();
foreach (String ips in IPList) {
String ip = ips.Trim();
if (ip.Length == 0) continue;
ListViewItem lvi = new ListViewItem(ip);
lvi.SubItems.Add("調査中");
lvi.SubItems.Add("");
lvl.Items.Add(lvi);
lvi.Name = Guid.NewGuid().ToString("N");
IPAddress addr = IPAddress.Parse(ip);
Quest a = new Quest(addr, lvi.Name);
BackgroundWorker bwStat = new BackgroundWorker();
bwStat.DoWork += new DoWorkEventHandler(bwStat_DoWork);
bwStat.RunWorkerAsync(a);
BackgroundWorker bwName = new BackgroundWorker();
bwName.DoWork += new DoWorkEventHandler(bwName_DoWork);
bwName.RunWorkerAsync(a);
}
}
示例9: SerializeQuest
internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
{
if (Message == null || Session == null)
{
return;
}
int amountOfQuestsInCategory = MercuryEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
checked
{
int num = (Quest == null) ? amountOfQuestsInCategory : (Quest.Number - 1);
int num2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
if (Quest != null && Quest.IsCompleted(num2))
{
num++;
}
Message.AppendString(Category);
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : num));
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
Message.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
Message.AppendUInt((Quest == null) ? 0u : Quest.Id);
Message.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
Message.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
Message.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
Message.AppendInt32((Quest == null) ? 0 : Quest.Reward);
Message.AppendString((Quest == null) ? string.Empty : Quest.Name);
Message.AppendInt32(num2);
Message.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
Message.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
Message.AppendString("");
Message.AppendString("");
Message.AppendBoolean(true);
}
}
示例10: IsPassRequirements
public static bool IsPassRequirements(Quest quest)
{
if (QuestsController.reference.CheckRequirements(quest))
return true;
return false;
}
示例11: AddQuest
//When we need to add a quest to the Quest list, we do it here.
public void AddQuest(int OverallID)
{
if (CurrentQuest == null)
{
//Sets a current quest if we don't have one.
for (int i = 0; i < QList.Count; i++)
{
if (QList [i].OverallID == OverallID)
{
CurrentQuest = QList [i];
CurrentQuest.CurrentQuest = true;
if (OnQuestGet != null)
{
OnQuestGet ();
}
UpdateQuest (OverallID);
return;
}
}
}
else
{
//Else just add the quest to the list/quest log.
for (int i = 0; i < QList.Count; i++)
{
if (QList [i].OverallID == OverallID)
{
QuestList.Add (QList [i]);
return;
}
}
}
}
示例12: Start
// Use this for initialization
void Start () {
var q0 = new Quest("bed", "Wakey wakey eggs and bakey. Rise and shine!", true);
q0.AddObjective(new Objective("leaveBed"));
quests.Add(q0);
var q1 = new Quest("wakeup", "Clock is ringing, you should do something about that", true);
q1.AddObjective(new Objective("shootAlarm"));
quests.Add(q1);
var q2 = new Quest("shower", "Shower without your dad", false);
q2.AddObjective(new Objective("shower"));
quests.Add(q2);
var q4 = new Quest("bacon", "Bakin' bacon pancakes", false);
q4.AddObjective(new Objective("shootFridge"));
q4.AddObjective(new Objective("getBacon"));
q4.AddObjective(new Objective("putBaconOnOven"));
q4.AddObjective(new Objective("heatOven"));
q4.AddObjective(new Objective("fryBacon"));
quests.Add(q4);
var q5 = new Quest("car", "Get to work", false);
q5.completesLevel = true;
q5.AddObjective(new Objective("getInCar"));
quests.Add(q5);
player = FindObjectOfType<Player>();
TrapPlayer();
}
示例13: UpdateQuest
void UpdateQuest()
{
selectQuest = null;
playerQuest = PlayerState._instance.GetPlayerQuest();
for (int i = 0; i < questShowList.Count; i++)
{
NGUITools.Destroy(questShowList[i]);
}
questShowList.Clear();
foreach (KeyValuePair<int, Quest> item in playerQuest.GetAcceptQuestList())
{
if (selectQuest == null)
{
selectQuest = item.Value;
}
if (!item.Value.isOver)
{
goQuest = NGUITools.AddChild(containQuestGrid, prefabQuestButton);
goQuest.transform.Find("Title").GetComponent<UILabel>().text = string.Format("Quest:{0}", item.Value.info.name);
goQuest.transform.Find("Doing").GetComponent<UILabel>().text = string.Format("Doing : Step {0}", item.Value.stepNow);
goQuest.name = item.Key.ToString();
questShowList.Add(goQuest);
}
}
containQuestGrid.GetComponent<UIGrid>().enabled = true;
UpdateStep();
}
示例14: CallOnNode
protected override void CallOnNode (ref string name, List<ParserValue> pairs) {
if (name == "Quests/Quest") {
quest = Quest.Create (pairs [0].value);
QuestArchive.Add(quest);
}
if (name == "Quests/Quest/Task") {
if (pairs.Count <= 3) {
quest.AddTask (pairs [0].value, pairs [1].value, int.Parse(pairs [2].value));
} else {
quest.AddTask (pairs [0].value, pairs [1].value, int.Parse(pairs [3].value), pairs[2].value);
}
}
if (name == "Quests/Quest/Activates") {
foreach (ParserValue pair in pairs) {
quest.toActivateIds.Add(pair.value);
}
}
if (name == "Quests/Quest/Adventure/Call") {
quest.AddCall(pairs [0].value);
}
if (name == "Quests/Quest/Adventure/Call/ActivateParams") {
for (int i = 0; i < pairs.Count; i++) {
quest.calls [quest.calls.Count - 1].activateParams.Add (pairs [i].value);
}
}
}
示例15: FindQuest_RewardAssociatedToItem_ItemShouldMatch
public void FindQuest_RewardAssociatedToItem_ItemShouldMatch()
{
var quest = new Quest { Name = "Test Quest #1" };
var item = new Item { Name = "Item #1" };
using (var db = new QuestManagerContext())
{
quest.Name = "Test Quest #1";
quest.Rewards = new List<Reward>
{
new Reward{Type = "item", Quantity = 1, Item = item },
};
db.Quests.Add(quest);
db.SaveChanges();
}
using (var db = new QuestManagerContext())
{
var actualQuest = db.Quests.Find(quest.QuestId);
Assert.AreEqual(1, actualQuest.Rewards.Count);
Assert.AreEqual(item.ItemId, actualQuest.Rewards.ElementAt(0).Item.ItemId);
Assert.AreEqual(item.Name, actualQuest.Rewards.ElementAt(0).Item.Name);
}
}