Exemple #1
0
public class ExampleQuest : Quest { // Derives from quest class
    // Use this for initialization
    void Start()
    {
        // Initialise quest
        questName        = "Example Quest";
        questDescription = "Kill enemies to complete this quest.";
        itemReward       = ItemDatabase.instance.GiveItem(itemRewardSlug);
        experienceReward = 100;
        isFinalQuest     = true;

        // For each kill objective
        for (int i = 0; i < differentEnemiesToKill__EnterSlugNameInElement.Length; i++)
        {
            //Debug.Log("Kill " + numberToKill__CorrespondingOrder[i] + " " + differentEnemiesToKill__EnterSlugNameInElement[i]);

            // Add new kill objective with the information given
            GoalList.Add(new KillQuestObjective(this, 1, "Kill " + numberToKill__CorrespondingOrder[i] + " " + differentEnemiesToKill__EnterSlugNameInElement[i], false, 0, numberToKill__CorrespondingOrder[i]));
        }

        // For each collection objective
        for (int j = 0; j < differentItemsToCollect__EnterSlugNameInElement.Length; j++)
        {
            // Add new collection objective with the information given
            GoalList.Add(new CollectionQuestObjective(this, differentItemsToCollect__EnterSlugNameInElement[j], "Find " + numberToCollect__CorrespondingOrder[j] + " " + differentItemsToCollect__EnterSlugNameInElement[j], false, 0, numberToCollect__CorrespondingOrder[j]));
        }

        // Initialise each objective in goal list
        GoalList.ForEach(x => x.Initialise());
    }
 public GoalListBlock()
 {
     InitializeComponent();
     Goals         = new GoalList();
     ListName.Text = Goals.Name;
     Goals.TasksCountEditedEvent += SetGoalCountText;
 }
Exemple #3
0
        public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string codeName = "", string codeName2 = "")
        {
            IEnumerable <goal> GoalList;

            ViewBag.BeginDate = bDate;
            ViewBag.EndDate   = eDate;

            if (SearchType == "MinistrySearch")
            {
                GoalList = GoalRepository.GetGoalByMinistry(codeID);
            }
            else if (SearchType == "StatusSearch")
            {
                GoalList = GoalRepository.GetGoalByStatus(codeName);
            }
            else if (SearchType == "Begin Date Search")
            {
                GoalList = GoalRepository.GetGoalBeginning(bDate, eDate);
            }
            else if (SearchType == "End Date Search")
            {
                GoalList = GoalRepository.GetGoalEnding(bDate, eDate);
            }
            else if (SearchType == "CompletionRatioSearch")
            {
                GoalList = GoalRepository.GetGoalByCompletionRatio(codeName);
            }
            else
            {
                GoalList = GoalRepository.GetGoalByDateRange(bDate, eDate);
            }

            ViewBag.RecordCount = GoalList.Count();

            foreach (goal g in GoalList)
            {
                g.ministry = MinistryRepository.GetMinistryByID(g.ministryID);
            }

            //security
            ViewBag.Supervisor = false;
            int memberID = Convert.ToInt16(System.Web.HttpContext.Current.Session["personID"]);

            if (memberID > 0)
            {
                if (MembershipRepositroy.IsUser(memberID))
                {
                    user user = MembershipRepositroy.GetUserByID(memberID);
                    if ((user.role.Name == "WebMaster") || (user.role.Name == "Pastor") || (user.role.Name == "Admin") || (user.role.Name == "Officer")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                }
            }


            return(PartialView(GoalList));
        }
        public GoalListBlock(GoalList goals)
        {
            InitializeComponent();

            foreach (var goal in Goals.Tasks)
            {
                ListStackPanel.Children.Add(new GoalBlock(goal, this));
            }
            ListName.Text = Goals.Name;
        }
    /// <summary>
    /// This procedure contains the user code. Input parameters are provided as regular arguments,
    /// Output parameters as ref arguments. You don't have to assign output parameters,
    /// they will have a default value.
    /// </summary>


    private void RunScript(List <object> Goals, bool Reset, bool Step, ref object A, ref object B, ref object C, ref object D, ref object E, ref object F)
    {
        // <Custom code>
        if (Reset)
        {
            PS      = new KangarooSolver.PhysicalSystem();
            counter = 0;
            GoalList.Clear();
            foreach (IGoal G in Goals)      //Assign indexes to the particles in each Goal:
            {
                PS.AssignPIndex(G, 0.0001); // the second argument is the tolerance distance below which points combine into a single particle
                GoalList.Add(G);
            }
        }
        if (Step)
        {
            PS.SimpleStep(GoalList);
            counter++;
        }


        A = PS.GetOutput(GoalList);
        B = counter;
        C = PS.GetAllMoves(GoalList);
        D = PS.GetAllWeightings(GoalList);
        E = PS.GetPositionArray();

        var Names = new List <String> [PS.ParticleCount()];

        for (int i = 0; i < PS.ParticleCount(); i++)
        {
            Names[i] = new List <String>();
        }

        for (int i = 0; i < GoalList.Count; i++)
        {
            var  FullName = GoalList[i].ToString();
            Char splitter = '.';
            var  Name     = FullName.Split(splitter);
            if (Name[0] != "KangarooSolver")
            {
                Name = FullName.Split('_', '+');
            }
            var G = GoalList[i] as IGoal;

            for (int j = 0; j < G.PIndex.Count(); j++)
            {
                Names[G.PIndex[j]].Add(Name[2]);
            }
        }


        F = Names;
        // </Custom code>
    }
Exemple #6
0
 public void Reset_Goals()
 {
     Debug.Log("Goals Reset");
     List    = new GoalList[6];
     List[0] = new GoalList("Mario Man In Training", "Jump 10 Times", "jump", 10);
     List[1] = new GoalList("OK We Get It", "Jump 20 Times", "jump", 20);
     List[2] = new GoalList("Now Your Just Showing Off", "Jump 100 Times", "jump", 100);
     List[3] = new GoalList("Ouch", "Hit By Enemy", "hit", 1);
     List[4] = new GoalList("You Gotta Try Harder Than That", "Hit By Enemy 10 Times", "hit", 10);
     List[5] = new GoalList("Just Starting", "Finished First Level", "end_level", 1);
 }
Exemple #7
0
        public ActionResult ListMinistry(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string codeName = "", string codeName2 = "")
        {
            IEnumerable <goal> GoalList;

            if (SearchType == "MinistrySearch")
            {
                GoalList = GoalRepository.GetGoalByMinistry(codeID);
            }
            else if (SearchType == "StatusSearch")
            {
                GoalList = GoalRepository.GetGoalByStatus(codeName);
            }
            else if (SearchType == "Begin Date Search")
            {
                GoalList = GoalRepository.GetGoalBeginning(bDate, eDate);
            }
            else if (SearchType == "End Date Search")
            {
                GoalList = GoalRepository.GetGoalEnding(bDate, eDate);
            }
            else if (SearchType == "CompletionRatioSearch")
            {
                GoalList = GoalRepository.GetGoalByCompletionRatio(codeName);
            }
            else
            {
                GoalList = GoalRepository.GetGoalByDateRange(bDate.Date, eDate.Date);
            }

            foreach (goal g in GoalList)
            {
                g.ministry = MinistryRepository.GetMinistryByID(g.ministryID);
                if (g.AssignedTo > 0)
                {
                    g.PersonAssignedTo.member = MemberRepository.GetMemberByID((int)g.AssignedTo);
                }
            }

            ministry ministry = MinistryRepository.GetMinistryByID(codeID);

            ViewBag.Ministry    = ministry;
            ViewBag.RecordCount = GoalList.Count();

            ViewBag.Heading      = string.Format("List of Goals for {0}", ministry.MinistryName);
            ViewBag.MinistryName = ministry.MinistryName;

            return(PartialView(GoalList));
        }
Exemple #8
0
        protected override Task LastPartOfSetUpBeforeBindingsAsync()
        {
            if (_model !.Deck1 !.CardExists(1))
            {
                throw new BasicBlankException("The first card cannot be in the deck");
            }

            PlayerList !.ForEach(thisPlayer =>
            {
                thisPlayer.KeeperList.Clear();
            });
            SaveRoot !.GoalList.Clear();
            SaveRoot.QueList.Clear(); //i think.
            SaveRoot.SavedActionData.TempDiscardList.Clear();
            SaveRoot.SavedActionData.TempHandList.Clear();
            SaveRoot.SavedActionData.SelectedIndex = -1;
            SaveRoot.CurrentAction = 0;
            SaveRoot.RuleList.Clear();
            SaveRoot.RuleList.Add((RuleCard)_gameContainer.DeckList !.GetSpecificItem(1));
            LastStepAll();
            return(base.LastPartOfSetUpBeforeBindingsAsync());
        }
    /// <summary>
    /// This procedure contains the user code. Input parameters are provided as regular arguments,
    /// Output parameters as ref arguments. You don't have to assign output parameters,
    /// they will have a default value.
    /// </summary>
    private void RunScript(List <object> Goals, bool Reset, bool Step, ref object A, ref object B)
    {
        if (Reset)
        {
            PS      = new KangarooSolver.PhysicalSystem();
            counter = 0;
            GoalList.Clear();
            foreach (IGoal G in Goals)      //Assign indexes to the particles in each Goal:
            {
                PS.AssignPIndex(G, 0.0001); // the second argument is the tolerance distance below which points combine into a single particle
                GoalList.Add(G);
            }
        }
        if (Step)
        {
            PS.Step(GoalList, true, 1);
            counter++;
        }

        A = PS.GetOutput(GoalList);
        B = counter;
    }
Exemple #10
0
 public async Task DiscardGoalAsync(GoalCard thisCard)
 {
     _gameContainer.SaveRoot !.GoalList.RemoveObjectByDeck((int)thisCard.Deck);
     await _gameContainer.AnimatePlayAsync !(thisCard);
 }