Example #1
0
        public static bool MarkObject(LogicObjects.LogicEntry CheckedObject)
        {
            if (CheckedObject.RandomizedItem > -2)
            {
                CheckedObject.RandomizedItem = -2; return(true);
            }
            if (CheckedObject.SpoilerRandom > -2)
            {
                CheckedObject.RandomizedItem = CheckedObject.SpoilerRandom; return(true);
            }
            if (CheckedObject.RandomizedState() == 2)
            {
                CheckedObject.RandomizedItem = CheckedObject.ID; return(true);
            }
            Tools.CurrentSelectedItem = CheckedObject;
            ItemSelect ItemSelectForm = new ItemSelect(); var dialogResult = ItemSelectForm.ShowDialog();

            if (dialogResult != DialogResult.OK)
            {
                Tools.CurrentSelectedItem = new LogicObjects.LogicEntry(); return(false);
            }
            if (Tools.CurrentSelectedItem.ID < 0)
            {
                CheckedObject.RandomizedItem = -1; Tools.CurrentSelectedItem = new LogicObjects.LogicEntry(); return(true);
            }
            CheckedObject.RandomizedItem = Tools.CurrentSelectedItem.ID;
            Tools.CurrentSelectedItem    = new LogicObjects.LogicEntry();
            return(true);
        }
Example #2
0
        public static bool CheckObject(LogicObjects.LogicEntry CheckedObject, LogicObjects.TrackerInstance Instance)
        {
            if (CheckedObject.Checked && CheckedObject.RandomizedItem > -2)
            {
                CheckedObject.Checked = false;
                if (CheckedObject.RandomizedItem > -1 && CheckedObject.RandomizedItem < Instance.Logic.Count && !Tools.SameItemMultipleChecks(CheckedObject.RandomizedItem, Instance))
                {
                    Instance.Logic[CheckedObject.RandomizedItem].Aquired = false;
                    CheckEntrancePair(CheckedObject, Instance, false);
                }
                CheckedObject.RandomizedItem = -2;
                return(true);
            }
            if (CheckedObject.SpoilerRandom > -2 || CheckedObject.RandomizedItem > -2 || CheckedObject.RandomizedState() == 2)
            {
                CheckedObject.Checked = true;
                if (CheckedObject.RandomizedState() == 2)
                {
                    CheckedObject.RandomizedItem = CheckedObject.ID;
                }
                if (CheckedObject.SpoilerRandom > -2)
                {
                    CheckedObject.RandomizedItem = CheckedObject.SpoilerRandom;
                }
                if (CheckedObject.RandomizedItem < 0)
                {
                    CheckedObject.RandomizedItem = -1; return(true);
                }
                Instance.Logic[CheckedObject.RandomizedItem].Aquired = true;
                CheckEntrancePair(CheckedObject, Instance, true);
                return(true);
            }
            Tools.CurrentSelectedItem = CheckedObject; //Set the global CurrentSelectedItem to the Location selected in the list box
            ItemSelect ItemSelectForm = new ItemSelect(); var dialogResult = ItemSelectForm.ShowDialog();

            if (dialogResult != DialogResult.OK)
            {
                Tools.CurrentSelectedItem = new LogicObjects.LogicEntry(); return(false);
            }
            CheckedObject.Checked = true;
            if (Tools.CurrentSelectedItem.ID < 0) //At this point CurrentSelectedItem has been changed to the selected item
            {
                CheckedObject.RandomizedItem = -1; Tools.CurrentSelectedItem = new LogicObjects.LogicEntry(); return(true);
            }
            CheckedObject.RandomizedItem = Tools.CurrentSelectedItem.ID;
            Instance.Logic[Tools.CurrentSelectedItem.ID].Aquired = true;
            Tools.CurrentSelectedItem = new LogicObjects.LogicEntry();
            CheckEntrancePair(CheckedObject, Instance, true);

            return(true);
        }
Example #3
0
 public static bool Randomized(this LogicObjects.LogicEntry entry)
 {
     return(entry.RandomizedState() == 0);
 }