Esempio n. 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            //Version 0
            if (version >= 0)
            {
                Charges          = reader.ReadInt();
                LastSearchMode   = (SearchModeType)reader.ReadInt();
                LastSearchLength = (SearchLengthType)reader.ReadInt();
            }
        }
Esempio n. 2
0
        }                                                                    //used to look for unlabeled proteins (in addition to labeled proteins) for SILAC experiments

        public override bool Equals(object obj)
        {
            return(obj is DigestionParams a &&
                   MaxMissedCleavages.Equals(a.MaxMissedCleavages) &&
                   MinPeptideLength.Equals(a.MinPeptideLength) &&
                   MaxPeptideLength.Equals(a.MaxPeptideLength) &&
                   InitiatorMethionineBehavior.Equals(a.InitiatorMethionineBehavior) &&
                   MaxModificationIsoforms.Equals(a.MaxModificationIsoforms) &&
                   MaxModsForPeptide.Equals(a.MaxModsForPeptide) &&
                   Protease.Equals(a.Protease) &&
                   SearchModeType.Equals(a.SearchModeType) &&
                   FragmentationTerminus.Equals(a.FragmentationTerminus) &&
                   GeneratehUnlabeledProteinsForSilac.Equals(a.GeneratehUnlabeledProteinsForSilac));
        }
Esempio n. 3
0
        public void StartSearch(PlayerMobile player, SearchModeType searchMode, SearchLengthType searchLength)
        {
            player.SendMessage("You begin searching.");

            int    searchIntervals  = 1;
            double intervalDuration = 5;

            player.BeginAction(typeof(Spyglass));

            switch (searchLength)
            {
            case SearchLengthType.Short:
                NextUsageAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(5);
                searchIntervals  = 1;
                break;

            case SearchLengthType.Medium:
                NextUsageAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(15);
                searchIntervals  = 3;
                break;

            case SearchLengthType.Long:
                NextUsageAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(30);
                searchIntervals  = 6;
                break;
            }

            for (int a = 0; a < searchIntervals; a++)
            {
                if (a == 0)
                {
                    if (player.NetState != null)
                    {
                        player.PrivateOverheadMessage(MessageType.Regular, player.SpeechHue, false, "*begins scanning the horizon*", player.NetState);
                    }
                }

                else
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(a * intervalDuration), delegate
                    {
                        if (player != null)
                        {
                            if (player.NetState != null)
                            {
                                player.PrivateOverheadMessage(MessageType.Regular, player.SpeechHue, false, "*continues scanning*", player.NetState);
                            }
                        }
                    });
                }
            }

            Timer.DelayCall(TimeSpan.FromSeconds(searchIntervals * intervalDuration), delegate
            {
                if (player == null)
                {
                    return;
                }

                player.EndAction(typeof(Spyglass));

                switch (searchMode)
                {
                case SearchModeType.Ships: player.Say("Ships");
                    break;

                case SearchModeType.Shipwrecks: player.Say("Shipwrecks");
                    break;

                case SearchModeType.SchoolsOfFish: player.Say("SchoolsOfFish");
                    break;
                }
            });

            Charges--;

            if (Charges <= 0)
            {
                Delete();
            }
        }