当前位置: 首页>>代码示例>>C#>>正文


C# Quest类代码示例

本文整理汇总了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;
        }
    }
开发者ID:neozman,项目名称:JunctionBox,代码行数:27,代码来源:Task.cs

示例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;
    }
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:25,代码来源:QuestSaveManager.cs

示例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);
        }
    }
开发者ID:markdion,项目名称:Unity-Projects,代码行数:29,代码来源:QuestDetailsScreen.cs

示例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);
    }
开发者ID:tof31320,项目名称:OfficeStoriesV2,代码行数:7,代码来源:QuestsManager.cs

示例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();
 }
开发者ID:thyagobr,项目名称:unity_studies,代码行数:7,代码来源:QuestManager.cs

示例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));
        }
开发者ID:patrickdenglerhobbisoft,项目名称:PimpIOs,代码行数:34,代码来源:QuestDetailsScreen.cs

示例7: QuestRealtimeProgressViewModel

        public QuestRealtimeProgressViewModel(Quest rpQuest)
        {
            r_Quest = rpQuest;

            DecreaseCommand = new DelegatedCommand(Decrease, CanDecrease);
            IncreaseCommand = new DelegatedCommand(Increase, CanIncrease);
        }
开发者ID:amatukaze,项目名称:IntelligentNavalGun-Fx4,代码行数:7,代码来源:QuestRealtimeProgressViewModel.cs

示例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);
            }
        }
开发者ID:windrobin,项目名称:kumpro,代码行数:26,代码来源:NForm.cs

示例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);
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:33,代码来源:QuestListComposer.cs

示例10: IsPassRequirements

	public static bool IsPassRequirements(Quest quest)
	{
		if (QuestsController.reference.CheckRequirements(quest))
			return true;
		return false;
			
	}
开发者ID:Gogeen,项目名称:GhostTrainAssets,代码行数:7,代码来源:QuestsController.cs

示例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;
             }
         }
     }
 }
开发者ID:dhurst22,项目名称:_80sActionHero,代码行数:34,代码来源:QuestManager.cs

示例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();
	}
开发者ID:SlothfulDesigns,项目名称:BaconGameJam10,代码行数:31,代码来源:Level1.cs

示例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();
    }
开发者ID:tsss-t,项目名称:SimpleStory,代码行数:30,代码来源:UIQuestManager.cs

示例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);
			}
		}
	}
开发者ID:Darthoul,项目名称:cena_gamejam,代码行数:27,代码来源:QuestParser.cs

示例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);
            }
        }
开发者ID:huddlestuff,项目名称:quest-manager,代码行数:25,代码来源:QuestManagerContextTests.cs


注:本文中的Quest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。