Example #1
0
        /// <summary>
        /// Enumerates all unique types. If B5701 is a type, then will NOT enumerate B57.
        /// If B5701 and B58 are types, then will enumerate both.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <string> EnumerateAll()
        {
            HashSet <string> reportedTwoDigit  = new HashSet <string>();
            HashSet <string> reportedFourDigit = new HashSet <string>();

            foreach (string six in _synChanges)
            {
                reportedFourDigit.Add(six.Substring(0, 4));
                reportedTwoDigit.Add(GetGroupStringFromHigherResolution(six));
                yield return(Locus.ToString() + six);
            }

            foreach (string four in _proteins)
            {
                if (!reportedFourDigit.Contains(four))
                {
                    reportedTwoDigit.Add(GetGroupStringFromHigherResolution(four));
                    yield return(Locus.ToString() + four);
                }
            }

            foreach (string two in _groups)
            {
                if (!reportedTwoDigit.Contains(two))
                {
                    yield return(Locus.ToString() + two);
                }
            }
        }
Example #2
0
    public Color ReadLocus(float temperature, Locus selectedLocus)
    {
        float temperatureNormalized = temperature / 30000f;

        if (temperatureNormalized > 1f || temperatureNormalized <= 0f)
        {
            Debug.LogError($"A star has a temperature of {temperature}, which is outside the range (1K, 30000 K]. The error color is applied.");
            return(Color.magenta);
        }
        Gradient heatingGradient;

        switch (selectedLocus)
        {
        case Locus.Planckian:
            heatingGradient = planckianLocus;
            break;

        case Locus.Alto:
            heatingGradient = altoLocus;
            break;

        case Locus.DramaticPlanckian:
            heatingGradient = dramaticPlanckianLocus;
            break;

        default:
            return(Color.black);
        }
        return(heatingGradient.Evaluate(temperatureNormalized));
    }
        private static void fill_locus(GenBankLocusInfo locus, long id)
        {
            Locus           loc      = new Locus(locus, id);
            MySqlCommand    cmmd10   = new MySqlCommand(loc.get_query(), conn);
            MySqlDataReader reader10 = cmmd10.ExecuteReader();

            reader10.Close();
        }
Example #4
0
        public static Locus CreateLocus(Drawing Drawing, IList <IFigure> dependencies)
        {
            var result = new Locus()
            {
                Drawing = Drawing, Dependencies = dependencies
            };

            return(result);
        }
 private static Locus BloodTypeAlleles( IWorld world)
 {
     var alleleMgr = new AlleleManager(world);
     var bloodType = new Locus("Blood Type", alleleMgr);
     var a = new Allele("A", true, .33);
     var b = new Allele("B", true, .33);
     var o = new Allele("O", false, .33);
     bloodType.AddAllele(a);
     bloodType.AddAllele(b);
     bloodType.AddAllele(o);
     return bloodType;
 }
 public bool deleteLocus(Locus locus)
 {
     try {
         using (var context = new ArchaeologyContext()) {
             context.Remove(locus);
             context.SaveChanges();
         }
     }
     catch (Exception ex) {
         throw new Exception(ex.Message, ex.InnerException);
     }
     return(true);
 }
 private static Locus SecondAllele(IWorld world)
 {
     var mgr = new AlleleManager(world);
     var locus = new Locus("Eye Color", mgr);
     locus.isVisibleLocus = true;
     var h = new Allele("H", false, .4);
     var bl = new Allele("B", true, .25);
     var red = new Allele("R", false, .1);
     var blue = new Allele("L", false, .25);
     locus.AddAllele(h);
     locus.AddAllele(bl);
     locus.AddAllele(blue);
     locus.AddAllele(red);
     return locus;
 }
Example #8
0
        /// <summary>
        /// Enumerates all values at the given resolution.
        /// </summary>
        /// <param name="resolution"></param>
        /// <returns></returns>
        public IEnumerable <string> Enumerate(HlaIResolution resolution)
        {
            switch (resolution)
            {
            case HlaIResolution.Group:
                return(_groups.Select(type => Locus.ToString() + type));

            case HlaIResolution.Protein:
                return(_proteins.Select(type => Locus.ToString() + type));

            case HlaIResolution.Synonymous:
                return(_synChanges.Select(type => Locus.ToString() + type));

            default:
                throw new NotImplementedException("Can't get here.");
            }
        }
        public Locus readLocus(Guid id)
        {
            var retList = new List <Locus>();
            var retVal  = new Locus();

            try {
                using (var context = new ArchaeologyContext()) {
                    retList = context.Locus
                              .Include(locus => locus.Square)
                              .Include(locus => locus.SeparationClarity)
                              .Where(locus => locus.Id == id)
                              .ToList();
                }
            }
            catch (Exception ex) {
                throw new Exception(ex.Message, ex.InnerException);
            }
            if (retList.Count > 0)
            {
                retVal = retList[0];
            }
            return(retVal);
        }
Example #10
0
    void Starter()
    {
        foreach (KMSelectable oke in mapbuttons)
        {
            oke.gameObject.SetActive(false);
        }
        foreach (KMSelectable oke in fitebuttons)
        {
            oke.gameObject.SetActive(false);
        }
        foreach (KMSelectable yes in emotebuttons)
        {
            yes.gameObject.SetActive(false);
        }
        Emote.gameObject.SetActive(false);
        VictoryRoyale.gameObject.SetActive(false);
        DateTime.TryParse("2019-09-20", out Area52);
        Ok ok;

        try
        {
            ok = JsonConvert.DeserializeObject <Ok>(wc.DownloadString(new Uri("https://api.exchangeratesapi.io/latest?base=AUD&symbols=USD")));
        } catch {
            ok = null;
        };
        _loci = new Locus[]
        {
            new Locus {
                index = 1, visibleName = "Rubbish Intersection", condition = Bomb.GetSolvableModuleNames().Contains("Waste Management")
            },
            new Locus {
                index = 2, visibleName = "Expensive Establishment", condition = true
            },
            new Locus {
                index = 3, visibleName = "Area 52", condition = System.DateTime.Compare(today, Area52) > 0
            },
            new Locus {
                index = 4, visibleName = "HTML is a programming language", condition = Bomb.GetOnIndicators().Contains("BOB")
            },
            new Locus {
                index = 5, visibleName = "“Mountain“", condition = Bomb.GetSerialNumberLetters().Any(x => new[] { 'I' }.Contains(x))
            },
            new Locus {
                index = 6, visibleName = "Retirement Hell", condition = Bomb.GetSolvableModuleNames().Contains("Retirement")
            },
            new Locus {
                index = 7, visibleName = "Scary Place (dont go ther)", condition = false
            },
            new Locus {
                index = 8, visibleName = "“Lemon Snow“", condition = true
            },
            new Locus {
                index = 9, visibleName = "Wall'z Mart", condition = Bomb.GetSolvableModuleNames().Contains("Cheap Checkout")
            },
            new Locus {
                index = 10, visibleName = "Pillage Pond", condition = Bomb.GetSolvableModuleNames().Contains("Splitting the Loot")
            },
            new Locus {
                index = 11, visibleName = "Ktane headeights", condition = true
            },
            new Locus {
                index = 12, visibleName = "Ok", condition = Bomb.GetIndicators().Any(x => new[] { "K" }.Contains(x))
            },
            new Locus {
                index = 13, visibleName = "Despacito Dancefloor", condition = Bomb.GetBatteryHolderCount() - Bomb.GetBatteryCount() < 0
            },
            new Locus {
                index = 14, visibleName = "Ligma Landing", condition = Bomb.GetSolvableModuleNames().Contains("Air Traffic Controller")
            },
            new Locus {
                index = 15, visibleName = "No", condition = false
            },
            new Locus {
                index = 16, visibleName = "Yes", condition = true
            },
            new Locus {
                index = 17, visibleName = "Australia", condition = false
            },
            //TODO: Add straya fix
            new Locus {
                index = 18, visibleName = "No Friends Notch", condition = Bomb.GetSolvableModuleNames().Contains("Bomb Diffusal")
            },
            new Locus {
                index = 19, visibleName = "Atomic Explosion", condition = Bomb.GetSolvableModuleNames().Contains("3D Maze")
            },
            new Locus {
                index = 20, visibleName = "Rainy Racecar", condition = true
            },
            new Locus {
                index = 21, visibleName = "Ligma Lake", condition = Bomb.GetSolvableModuleNames().Contains("Battleship")
            }
        };
        _weapons = new Weapon[]
        {
            new Weapon {
                name = "Ballpoint Pen", sprite = WeaponSprites[0], rarity = "com", attackDMG = 42, reloadTime = 6.3, spawnNumbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }
            },
            new Weapon {
                name = "Hugging Machine", sprite = WeaponSprites[1], rarity = "r", attackDMG = 69, reloadTime = 4.2, spawnNumbers = new int[] { 11, 12, 13 }
            },
            new Weapon {
                name = "Cut", sprite = WeaponSprites[2], rarity = "l", attackDMG = 75, reloadTime = 2.1, spawnNumbers = new int[] { 14 }
            },
            new Weapon {
                name = "Sharknado", sprite = WeaponSprites[3], rarity = "uncom", attackDMG = 52, reloadTime = 3.5, spawnNumbers = new int[] { 15, 16, 17, 18, 19 }
            },
            new Weapon {
                name = "Green Apple Yeeter", sprite = WeaponSprites[4], rarity = "l", attackDMG = 302, reloadTime = 10.32, spawnNumbers = new int[] { 20 }
            },
            new Weapon {
                name = "Hunting", sprite = WeaponSprites[5], rarity = "r", attackDMG = 99, reloadTime = 2.4, spawnNumbers = new int[] { 21, 22, 23 }
            },
            new Weapon {
                name = "Shoot Thing", sprite = WeaponSprites[6], rarity = "uncom", attackDMG = 22, reloadTime = 1.2, spawnNumbers = new int[] { 24, 25, 26, 27, 28 }
            },
            new Weapon {
                name = "AR-15", sprite = WeaponSprites[7], rarity = "r", attackDMG = 20, reloadTime = 3.5, spawnNumbers = new int[] { 29, 30, 31 }
            }
        };
        _opponents = new Opponent[]
        {
            new Opponent {
                name = "Balloon", sprite = EnemySprites[0], attackDMG = (Convert.ToInt32(Bomb.GetSolvedModuleNames().Count / (Bomb.GetSolvableModuleNames().Count - Bomb.GetSolvedModuleNames().Count) * 100)) % 100, health = Bomb.GetBatteryCount() * 10, spawnNumbers = new int[] { 1 }
            },
            new Opponent {
                name = "Noskin", sprite = EnemySprites[1], attackDMG = 10, health = 65, spawnNumbers = new int[] { 2, 3, 4 }
            },
            new Opponent {
                name = "Ucinorn", sprite = EnemySprites[2], attackDMG = 1, health = 1, spawnNumbers = new int[] { 1337 }
            },
            new Opponent {
                name = "Macca's", sprite = EnemySprites[3], attackDMG = Bomb.GetSerialNumberNumbers().Sum() * 100 % 15, health = Bomb.GetSerialNumberLetters().Sum(ltr => ltr - 'A' + 1), spawnNumbers = new int[] { 5 }
            },
            new Opponent {
                name = "Zombye", sprite = EnemySprites[4], attackDMG = 100, health = 90, spawnNumbers = new int[] { 6, 7 }
            },
            new Opponent {
                name = "yes", sprite = EnemySprites[5], attackDMG = 10, health = 30, spawnNumbers = new int[] { 9 }
            },
            new Opponent {
                name = "default", sprite = EnemySprites[6], attackDMG = 20, health = 80, spawnNumbers = new int[] { 10, 11 }
            }
        };

        generateNewOk();

        _emotes = new Emote[]
        {
            new Emote {
                sprite = EmoteSprites[0], ok = "armwiggle", weaponCondition = theWeapon.reloadTime < 2.2, opponentCondition = true
            },
            new Emote {
                sprite = EmoteSprites[1], ok = "Brakedanze", weaponCondition = theWeapon.attackDMG > 60, opponentCondition = theEnemy.health > 80
            },
            new Emote {
                sprite = EmoteSprites[2], ok = "Math", weaponCondition = theEnemy.name == "Ucinorn", opponentCondition = true
            },
            new Emote {
                sprite = EmoteSprites[3], ok = "Dab", weaponCondition = theWeapon.rarity.Equals("l"), opponentCondition = theEnemy.health < theWeapon.attackDMG
            },
            new Emote {
                sprite = EmoteSprites[4], ok = "Jaxfilms", weaponCondition = theWeapon.name == "AR-15", opponentCondition = true
            },
            new Emote {
                sprite = EmoteSprites[5], ok = "Avikeyy", weaponCondition = theWeapon.rarity.Equals("r"), opponentCondition = theEnemy.attackDMG > 40
            },
            new Emote {
                sprite = EmoteSprites[6], ok = "serbia stronk", weaponCondition = theWeapon.rarity.Equals("com"), opponentCondition = theEnemy.attackDMG > 80
            }
        };

        _AttackStrategies = new Okay[]
        {
            new Okay {
                publicName = "Shoot and Heal", condition = theEnemy.health < theWeapon.attackDMG
            },
            new Okay {
                publicName = "Kamikaze", condition = (theEnemy.health * 0.75 < theWeapon.attackDMG) && !(theEnemy.health < theWeapon.attackDMG)
            },
            new Okay {
                publicName = "Jump and Shoot", condition = (theEnemy.health * 0.5 < theWeapon.attackDMG) && !(theEnemy.health * 0.75 < theWeapon.attackDMG)
            },
            new Okay {
                publicName = "Dab on'em", condition = (theEnemy.health * 0.25 < theWeapon.attackDMG) && !(theEnemy.health * 0.5 < theWeapon.attackDMG)
            },
            new Okay {
                publicName = "Hide", condition = (theEnemy.health * 0.25 > theWeapon.attackDMG) && !(theEnemy.health * 0.25 < theWeapon.attackDMG)
            }
        };
        Emoti    = _emotes.ToList();
        locusses = _loci.ToList();

        StageTwoDisplayInt = Rnd.Range(0, 3);

        mapSprite.gameObject.SetActive(false);
        presstopaybutton.gameObject.SetActive(true);
        Fortnightlogo.gameObject.SetActive(true);
        Weapon.gameObject.SetActive(false);
        Opponent.gameObject.SetActive(false);

        int startingNumber = Convert.ToInt32(Bomb.GetIndicators().Count() + Bomb.GetModuleNames().Count * 3.14159 + Bomb.GetIndicators().Sum(ind => ind.Sum(l => l - 'A' + 1)));

        if (Bomb.GetSerialNumberLetters().Any(x => new[] { 'A', 'E', 'I', 'O', 'U' }.Contains(x)))
        {
            startingNumber = (startingNumber * 3) % 20 + 1;
        }
        else
        {
            startingNumber = (startingNumber * 2) % 20 + 1;
        }
        int currentNumber = startingNumber;

        LogMessage("Location calculation: Starting off at {0}", _loci[startingNumber].visibleName);
        foreach (Locus locus in _loci)
        {
            if (startingNumber % 2 == 1 && currentNumber % 2 == 0)
            {
            }
            else if (startingNumber % 2 != 1 && new int[] { 1, 5, 9 }.EqualsAny(currentNumber))
            {
            }
            else if (_loci[currentNumber].condition)
            {
                correctLocus = _loci[currentNumber];
                Debug.Log(_loci[currentNumber].visibleName);
                break;
            }
            currentNumber++;
        }
        LogMessage("Location caltulation: The correct location is {0}", correctLocus.visibleName);
    }