Пример #1
0
 /// <summary>
 /// 获取完整的变量名
 /// </summary>
 /// <param name="expr"></param>
 /// <param name="startPos"></param>
 /// <param name="funcStr"></param>
 /// <param name="endPos"></param>
 private void GetCompleteVarible(string expr, int startPos, out string varStr, out int endPos)
 {
     //int cpnum = 0;
     for (int i = startPos; i <= expr.Length - 1; i++)
     {
         char       c  = expr[i];
         LetterType lt = JudgeLetterType(c);
         //if (lt == LetterType.OpeningParenthesis)
         //    cpnum++;
         //else if (lt == LetterType.ClosingParenthesis)
         //{
         //    cpnum--;//考虑到函数嵌套的情况,消除掉内部括号
         //    if (cpnum == 0)
         //    {
         //        endPos = i;
         //        varStr = expr.Substring(startPos, endPos - startPos + 1);
         //        return;
         //    }
         //}
         if (lt != LetterType.Variable && c != '.')
         {
             endPos = i - 1;
             varStr = expr.Substring(startPos, endPos - startPos + 1);
             return;
         }
     }
     varStr = expr.Substring(startPos);
     endPos = expr.Length - 1;
 }
Пример #2
0
 public async Task <LetterTemplate> GetTemplate(LetterType type)
 {
     return(await _requestProvider.BuildUpon(_url)
            .Uri($"/api/letter/template/{(int)type}")
            .AddInterceptor(new JsonDeserializerInterceptor())
            .Execute <LetterTemplate>());
 }
Пример #3
0
        /// <summary>
        /// 获取完整的函数表达式
        /// </summary>
        /// <param name="expr"></param>
        /// <param name="startPos"></param>
        /// <param name="funcStr"></param>
        /// <param name="endPos"></param>
        private void GetCompleteFunction(string expr, int startPos, out string funcStr, out int endPos)
        {
            int cpnum = 0;

            for (int i = startPos; i <= expr.Length - 1; i++)
            {
                char       c  = expr[i];
                LetterType lt = JudgeLetterType(c);
                if (lt == LetterType.OpeningParenthesis)
                {
                    cpnum++;
                }
                else if (lt == LetterType.ClosingParenthesis)
                {
                    cpnum--;//考虑到函数嵌套的情况,消除掉内部括号
                    if (cpnum == 0)
                    {
                        endPos  = i;
                        funcStr = expr.Substring(startPos, endPos - startPos + 1);
                        return;
                    }
                }
            }
            funcStr = expr.Substring(startPos);
            endPos  = expr.Length - 1;
        }
Пример #4
0
        /// <summary>
        /// Draw the ascii clock, only redraws what has changed.
        /// </summary>
        /// <param name="a_elapsed"></param>
        private void Draw(ElapsedResult a_elapsed)
        {
            int posX = StartX;
            int posY = StartY;

            int storedPosition = 0;

            foreach (char letter in a_elapsed.hours)
            {
                LetterType type = GetLetterType(letter);
                TryDraw(type, ref posX, posY, ref storedPosition);
            }

            TryDraw(LetterType.Colon, ref posX, posY, ref storedPosition);

            foreach (char letter in a_elapsed.minutes)
            {
                LetterType type = GetLetterType(letter);
                TryDraw(type, ref posX, posY, ref storedPosition);
            }

            TryDraw(LetterType.Colon, ref posX, posY, ref storedPosition);

            foreach (char letter in a_elapsed.seconds)
            {
                LetterType type = GetLetterType(letter);
                TryDraw(type, ref posX, posY, ref storedPosition);
            }
        }
Пример #5
0
        public void SetFullLetter(LetterView letterView)
        {
            if (letterView != null)
            {
                LetterType letterType = ClientRequests.GetLetterType(letterView.Type);
                ILetterPropertiesUIPlugin clientUIPlugin;

                disableControls(splitContainer1.Panel2.Controls);

                if (!_letterPropertiesUIPlugins.TryGetValue(letterType.TypeClientUI, out clientUIPlugin))
                {
                    clientUIPlugin = ((PluginService)(ServiceProvider.GetService(typeof(PluginService)))).GetLetterPropetiesPlugin(letterType);
                    _letterPropertiesUIPlugins.Add(letterType.TypeClientUI, clientUIPlugin);

                    splitContainer1.Panel2.Controls.Add((Control)clientUIPlugin);
                }

                clientUIPlugin.LetterView = letterView;
                clientUIPlugin.ReadOnly   = true;

                this.Size = new Size(splitContainer2.Size.Width + ((Control)clientUIPlugin).Size.Width, Math.Max(splitContainer2.Size.Height, ((Control)clientUIPlugin).Size.Height));

                enableControl((Control)clientUIPlugin);
            }
        }
Пример #6
0
 public LetterResult(bool isLetter = false, bool isUpper = false, LetterType type = LetterType.Default, bool isMark = false)
 {
     IsLetter = isLetter;
     IsUpper  = isUpper;
     Type     = type;
     IsMark   = false;
 }
Пример #7
0
        static void SendWelcomeLetter(OG_OutpostData outpostData)
        {
            string     eventTitle   = "";
            string     eventText    = "";
            LetterType letterType   = LetterType.BadNonUrgent;
            int        sectorCoordX = Find.Map.WorldCoords.x;
            int        sectorCoordZ = Find.Map.WorldCoords.z;
            int        rimLawNumber = Rand.RangeInclusive(25, 1350);

            if (outpostData.isMilitary)
            {
                eventTitle = "MiningCo. military outpost";
                eventText  = "   MiningCo. warning message\n\n" +
                             "   Hello! I am Coralie, the AI in charge of outpost X" + sectorCoordX + ".Z" + sectorCoordZ + " Mil.\n\n" +
                             "My scanners detected the signature of your escape pods crashing nearby.\n\n" +
                             "WARNING! You are entering an MiningCo. military sector. No activity is authorized here.\n\n" +
                             "Please notice that anyone found in the sector will be shot on sight with regards to the RimLaw RL-" + rimLawNumber + ".\n\n" +
                             "---- End of transmision ---";
                letterType = LetterType.BadUrgent;
            }
            else
            {
                eventTitle = "MiningCo. civil outpost";
                eventText  = "   MiningCo. information message\n\n" +
                             "   Hello! I am Coralie, the AI in charge of outpost X" + sectorCoordX + ".Z" + sectorCoordZ + " Civ.\n\n" +
                             "My scanners detected the signature of your escape pods crashing nearby.\n" +
                             "My emotional analyzer tells me to be sorry for your ship and the people who most probably died within.\n\n" +
                             "I remind you this sector is the legal property of MiningCo. However, the company generously grants you the right to pass through this sector.\n\n" +
                             "Please notice that any intruder found inside the outpost perimeter will be shot on sight with regards to the RimLaw RL-" + rimLawNumber + ".\n\n" +
                             "---- End of transmision ---";
                letterType = LetterType.Good;
            }
            Find.LetterStack.ReceiveLetter(eventTitle, eventText, letterType);
        }
Пример #8
0
 public Letter(
     long LoginID          = default,
     string MsgID          = default,
     long OtherID          = default,
     string OtherName      = default,
     bool IsReceived       = default,
     bool Unread           = default,
     LetterType LetterType = default,
     bool OtherIsOnline    = default,
     string Content        = default,
     DateTime STime        = default,
     string Photo          = default)
 {
     AddCell("ID", 0);
     AddCell("LoginID", LoginID);
     AddCell("MsgID", MsgID);
     AddCell("OtherID", OtherID);
     AddCell("OtherName", OtherName);
     AddCell("IsReceived", IsReceived);
     AddCell("Unread", Unread);
     AddCell("LetterType", LetterType);
     AddCell("OtherIsOnline", OtherIsOnline);
     AddCell("Content", Content);
     AddCell("STime", STime);
     AddCell("Photo", Photo);
     IsAdded = true;
     AttachHook();
 }
Пример #9
0
 public IEnumerable <LetterType> GetAllLetterTypes()
 {
     using (IDbConnection connection = DatabaseService.CreateOpenConnection())
     {
         using (IDbCommand command = DatabaseService.CreateStoredProcCommand(SpGetAllLetterTypes, connection))
         {
             using (IDataReader reader = command.ExecuteReader())
             {
                 var allTypes = new List <LetterType>();
                 while (reader.Read())
                 {
                     var type = new LetterType()
                     {
                         Id           = reader.GetInt32(reader.GetOrdinal(Id)),
                         TypeClientUI = reader.GetString(reader.GetOrdinal(TypeClientUI)),
                         Name         = reader.GetString(reader.GetOrdinal(Name))
                     };
                     if (!string.IsNullOrEmpty(type.TypeClientUI))
                     {
                         allTypes.Add(type);
                     }
                 }
                 if (allTypes.Count == 0)
                 {
                     throw new Exception("No types");
                 }
                 return(allTypes);
             }
         }
     }
 }
Пример #10
0
        private void ReceiverReceived(ILetter receivedLetter)
        {
            ResetHeartbeatTimer();

            LetterType letterType = receivedLetter.Type;

            if (letterType == LetterType.Ack)
            {
                HandleLetterSent(_queue.Dequeue());
            }
            else
            {
                if ((receivedLetter.Options & LetterOptions.Ack) == LetterOptions.Ack)
                {
                    if (_options.Notification.ReceivedNotifyOnAllAckStates && ((letterType & LetterType.User) == LetterType.User || (letterType & LetterType.Batch) == LetterType.Batch))
                    {
                        HandleReceivedLetter(receivedLetter, AckState.BeforeAck);
                    }

                    QueueAck(receivedLetter);
                }
                else
                {
                    HandleReceivedLetter(receivedLetter, AckState.NoAck);
                }
            }
        }
Пример #11
0
        public GcnPlayerMail(Save saveFile, Player owner, int index)
        {
            Index = index;
            switch (saveFile.SaveType)
            {
            case SaveType.DoubutsuNoMoriPlus:
                break;

            case SaveType.AnimalCrossing:
                Offset        = owner.Offset + 0x4E0 + index * 0x12A;
                RecipientInfo = new GCMailName(saveFile, Offset);
                SenderInfo    = new GCMailName(saveFile, Offset + 0x16);
                Present       = new Item(saveFile.ReadUInt16(Offset + 0x2C, true)); // TODO: There has to be a flag that tells the game if the item is wrapped or a quest item.
                LetterType    = (LetterType)saveFile.ReadByte(Offset + 0x2E);       // "Font"
                HeaderReceipiantStartOffset = saveFile.ReadByte(Offset + 0x2F);     // How many characters until the recipient's name should be inserted
                SenderType     = (LetterSenderType)saveFile.ReadByte(Offset + 0x30);
                StationaryType = new Item((ushort)(0x2000 | saveFile.ReadByte(Offset + 0x31)));
                Header         = saveFile.ReadString(Offset + 0x32, 0x18);
                Contents       = saveFile.ReadString(Offset + 0x4A, 0xC0);
                Footer         = saveFile.ReadString(Offset + 0x10A, 0x20);
                break;

            case SaveType.DoubutsuNoMoriEPlus:
                break;
            }
        }
Пример #12
0
    public void AddBag()
    {
        bag = GameObject.Instantiate(bagPrefab);

        List <LetterType> acceptedTypes = new List <LetterType>();
        LetterType        accepted      = (LetterType)random.Next(1, Enum.GetNames(typeof(LetterType)).Length);

        acceptedTypes.Add(accepted);
        acceptedTypes.Add(LetterType.Gold);

        bag.GetComponent <Bag>().Initialise(sprites[(int)accepted], acceptedTypes);
        bag.transform.SetParent(this.transform);
        bag.transform.position = this.bagPositions[0].transform.position;

        currentBagNumber          += 1;
        bagPositions[0].currentBag = bag;

        //GameEvents.current.PushBags();

        for (int i = bagPositions.Count - 1; i > 0; i--)
        {
            bagPositions[i].pushBag(bagPositions[i - 1].currentBag);
        }
        CheckBagQueue();
    }
Пример #13
0
 //=========================================================================================
 /// <summary>Найти позицию первого символа с указанным типом.</summary>
 static int GetFirstLetter(string line, int chr, LetterType letterType)
 {
     while (chr > 0 && GetLetterType(line[chr - 1]) == letterType)
     {
         chr--;
     }
     return(chr);
 }
Пример #14
0
 private static Boolean IsOperator(LetterType letterType)
 {
     if (letterType == LetterType.LeftParentheses || letterType == LetterType.RightParentheses || letterType == LetterType.Operator)
     {
         return(true);
     }
     return(false);
 }
Пример #15
0
        private LetterTypeDTO ToLetterTypeDTO(LetterType item)
        {
            LetterTypeDTO result = new LetterTypeDTO();

            result.ID   = item.ID;
            result.Name = item.Name;
            return(result);
        }
Пример #16
0
        public async Task <string> UpdateLetterTemplate(LetterType type,
                                                        [FromBody] LetterTemplate template)
        {
            template.Type = type;
            await _masterService.UpdateLetterTemplate(template);

            return("Ok");
        }
Пример #17
0
 //=========================================================================================
 /// <summary>Найти позицию последнего символа с указанным типом + 1.</summary>
 static int GetLastLetter(string line, int chr, LetterType letterType)
 {
     while (chr < line.Length && GetLetterType(line[chr]) == letterType)
     {
         chr++;
     }
     return(chr);
 }
Пример #18
0
        /// <summary>
        /// It tries to draw the letter type.
        /// It will only draw if the letter types are different.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="a_storedPosition"></param>
        private void TryDraw(LetterType type, ref int x, int y, ref int a_storedPosition)
        {
            if (type != m_storedLetters[a_storedPosition])
            {
                DrawLetterType(type, x, y);
                m_storedLetters[a_storedPosition] = type;
            }

            a_storedPosition++;
            x += GetLetterLength(type);
        }
Пример #19
0
        private int GetLetterLength(LetterType a_type)
        {
            switch (a_type)
            {
            case LetterType.Colon:
                return(2);

            default:
                return(4);
            }
        }
Пример #20
0
 public void TryToCaptureOutpost(string eventTitle, string eventText, LetterType letterType, Faction turretsNewFaction, bool deactivateTurrets,
                                 Faction doorsNewFaction, bool deactivateDoors, int dropPodsNumber, PawnKindDef securityForcesDef)
 {
     SetOutpostSecurityForcesHostileToColony();
     this.outpostThingList = OG_Util.RefreshThingList(this.outpostThingList);
     ChangeOutpostThingsFaction(null);
     ChangeOutpostTurretsFaction(turretsNewFaction, deactivateTurrets);
     ChangeOutpostDoorsFaction(doorsNewFaction, deactivateDoors);
     LaunchSecurityDropPods(dropPodsNumber, securityForcesDef, true);
     OG_Util.DestroyOutpostArea();
     Find.LetterStack.ReceiveLetter(eventTitle, eventText, letterType, new TargetInfo(this.Position));
 }
Пример #21
0
        public async Task <List <LetterTemplate> > GetTemplate(LetterType type)
        {
            var param = new DynamicParameters();

            param.Add("@Type", type);

            return((await SqlMapper.QueryAsync <LetterTemplate>(_unitOfWork.Connection,
                                                                "GetLetterTemplate",
                                                                param,
                                                                commandType: CommandType.StoredProcedure,
                                                                transaction: _unitOfWork.Transaction)).ToList());
        }
 public void TryToCaptureOutpost(string eventTitle, string eventText, LetterType letterType, Faction turretsNewFaction, bool deactivateTurrets,
     Faction doorsNewFaction, bool deactivateDoors, int dropPodsNumber, PawnKindDef securityForcesDef)
 {
     SetOutpostSecurityForcesHostileToColony();
     this.outpostThingList = OG_Util.RefreshThingList(this.outpostThingList);
     ChangeOutpostThingsFaction(null);
     ChangeOutpostTurretsFaction(turretsNewFaction, deactivateTurrets);
     ChangeOutpostDoorsFaction(doorsNewFaction, deactivateDoors);
     LaunchSecurityDropPods(dropPodsNumber, securityForcesDef, true);
     OG_Util.DestroyOutpostArea();
     Find.LetterStack.ReceiveLetter(eventTitle, eventText, letterType, new TargetInfo(this.Position));
 }
Пример #23
0
        public static bool IsLetter(char c, LetterType letterType)
        {
            bool isLetter = false;

            if (letterType != LetterType.upperCase && c >= 'a' && c <= 'z')
            {
                isLetter = true;
            }
            if (!isLetter && letterType != LetterType.lowerCase && c >= 'A' && c <= 'Z')
            {
                isLetter = true;
            }
            return(isLetter);
        }
Пример #24
0
        private void SendLetterB_Click(object sender, EventArgs e)
        {
            LetterType selectedLetterType            = ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).SelectedLetterType;
            ILetterPropertiesUIPlugin clientUIPlugin = ((PluginService)(ServiceProvider.GetService(typeof(PluginService)))).GetLetterPropetiesPlugin(selectedLetterType);

            global::Registration.SerializationService.LetterProperties letterProp = clientUIPlugin.GetLetterProperties();
            LetterView letterView = clientUIPlugin.StandartLetter;

            if (SendLetter(letterView.Name, ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).Worker.Id, NamesAndLoginsReceivers, letterView.Text, letterProp.ToString(), selectedLetterType.Id))
            {
                MessageService.InfoMessage(Message.MessageResource.SentLetter);
                Close();
            }
        }
Пример #25
0
        public void InitializeForm()
        {
            InitializeClientService();
            InitializeMessageService();
            InitializeBaseControls();

            LetterView letterView = ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).SelectedLetterView;

            LetterType selectedLetterType = ClientRequests.GetLetterType(letterView.Type);

            ILetterPropertiesUIPlugin newControl = ((PluginService)(ServiceProvider.GetService(typeof(PluginService)))).GetLetterPropetiesPlugin(selectedLetterType);

            newControl.LetterView = letterView;

            newControl.ReadOnly = true;

            int tabIndex = 0;

            newControl.OnLoad(ServiceProvider);

            ((Control)newControl).TabIndex = tabIndex;

            int heightSize = 0;
            int locationY  = 0;

            foreach (Control control in BaseControls)
            {
                if (control.Location.Y + control.Size.Height > locationY)
                {
                    locationY = control.Location.Y + control.Size.Height;
                }

                heightSize += control.Size.Height;
            }

            this.Controls.Clear();
            ((Control)newControl).Location = new Point(0, locationY);

            this.Size = new Size(((Control)newControl).Size.Width, ((Control)newControl).Size.Height + heightSize);

            this.Controls.Add(((Control)newControl));

            foreach (Control control in BaseControls)
            {
                ++tabIndex;
                control.TabIndex = tabIndex;
                this.Controls.Add(control);
            }
        }
Пример #26
0
 public void AddLetter(LetterType letterType)
 {
     if (acceptedTypes.Contains(letterType))
     {
         if (letterType == LetterType.Gold)
         {
             current = capacity;
         }
         else
         {
             current += 1;
         }
     }
     CheckCapacity();
 }
Пример #27
0
        public void InitializeForm()
        {
            InitializeClientService();
            InitializeMessageService();
            InitializeBaseControls();

            LetterView letterView = ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).SelectedLetterView;

            LetterType selectedLetterType = ClientRequests.GetLetterType(letterView.Type);


            ILetterPropertiesUIPlugin newControl = ((PluginService)(ServiceProvider.GetService(typeof(PluginService)))).GetLetterPropetiesPlugin(selectedLetterType);

            LetterProperties prop = new LetterProperties()
            {
            };

            int minXLocation        = int.MaxValue;
            int minYLocation        = int.MaxValue;
            int sizeForMinYLocation = 0;

            foreach (Control control in BaseControls)
            {
                minXLocation = Math.Min(control.Location.X, minXLocation);

                if (control.Location.Y < minYLocation)
                {
                    minYLocation        = control.Location.Y;
                    sizeForMinYLocation = control.Size.Height;
                }
            }
            ((Control)newControl).Location = new Point(minXLocation, minYLocation + sizeForMinYLocation);

            int width = Math.Max(BaseSizeHeight.X, ((Control)newControl).Width);

            this.Controls.Clear();

            this.Size = new Size(width, BaseSizeHeight.Y + ((Control)newControl).Size.Height);

            this.Controls.Add(((Control)newControl));

            foreach (Control control in BaseControls)
            {
                control.Location = new System.Drawing.Point(control.Location.X, control.Location.Y + ((Control)newControl).Size.Height);
                this.Controls.Add(control);
            }
        }
Пример #28
0
        private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            LetterType letterType = ((ApplicationState)ServiceProvider.GetService(typeof(ApplicationState))).SelectedLetterType;

            if (toolStripComboBox1.SelectedIndex >= 0 && null != _comboLettersTypes[toolStripComboBox1.SelectedIndex])
            {
                letterType.Id           = _comboLettersTypes[toolStripComboBox1.SelectedIndex].Id;
                letterType.Name         = _comboLettersTypes[toolStripComboBox1.SelectedIndex].Name;
                letterType.TypeClientUI = _comboLettersTypes[toolStripComboBox1.SelectedIndex].TypeClientUI;

                using (var makeLetterForm = new Forms.MakeLetterForm(ServiceProvider))
                {
                    makeLetterForm.ShowDialog();
                }
                InitializeMainWorkerForm();
            }
        }
Пример #29
0
        public void RemoveWord(int length, int numberOfLetter, LetterType letterType)
        {
            foreach (ISentence sentence in this.GetSentences())
            {
                List <Word> words = sentence.Items.OfType <Word>()
                                    .Where(item => item.Length == length && item.Length > numberOfLetter).ToList();

                for (int i = 0; i < words.Count(); i++)
                {
                    AlphabetItem alphabetItem = Alphabet.GetAlpabetItem(words[i].Items[numberOfLetter]);
                    if (alphabetItem.Equals(default(AlphabetItem)) == false && alphabetItem.LetterType == letterType)
                    {
                        sentence.RemoveItem(words[i]);
                    }
                }
            }
        }
Пример #30
0
        public static IList <string> GetAlphabet(LetterType letterType)
        {
            var alphabet = new List <string>();

            for (int i = 65; i <= 90; i++)
            {
                var letter = ((char)i).ToString();
                switch (letterType)
                {
                case LetterType.Uppercase:
                    letter = letter.ToUpper(); break;

                default: letter = letter.ToLower(); break;
                }
                alphabet.Add(letter);
            }
            return(alphabet);
        }
Пример #31
0
        LetterType GetLetterType(List <FileData> p_files)
        {
            LetterType type = LetterType.File;

            if (p_files.All(p_file => FileFilter.UwpImage.Contains(p_file.Ext.ToLower())))
            {
                type = LetterType.Image;
            }
            else if (p_files.All(p_file => FileFilter.UwpVideo.Contains(p_file.Ext.ToLower())))
            {
                type = LetterType.Video;
            }
            else if (p_files.All(p_file => FileFilter.UwpAudio.Contains(p_file.Ext.ToLower())))
            {
                type = LetterType.Voice;
            }
            return(type);
        }
Пример #32
0
		//=========================================================================================
		/// <summary>Найти позицию последнего символа с указанным типом + 1.</summary>
		static int GetLastLetter(string line, int chr, LetterType letterType)
		{
			while (chr < line.Length && GetLetterType(line[chr]) == letterType)
				chr++;
			return chr;
		}
Пример #33
0
		//=========================================================================================
		/// <summary>Найти позицию первого символа с указанным типом.</summary>
		static int GetFirstLetter(string line, int chr, LetterType letterType)
		{
			while (chr > 0 && GetLetterType(line[chr - 1]) == letterType)
				chr--;
			return chr;
		}
Пример #34
0
 private Boolean IsOperator(LetterType letterType)
 {
     if (letterType == LetterType.LeftParentheses || letterType == LetterType.RightParentheses || letterType == LetterType.Operator)
         return true;
     return false;
 }
 public void LaunchInvasion(string eventTitle, string eventText, float raidPointsFactor, int dropsNumber, LetterType letterType)
 {
     this.LaunchInvasion(eventTitle, eventText, raidPointsFactor, dropsNumber, letterType, IntVec3.Invalid);
 }
        public void LaunchInvasion(string eventTitle, string eventText, float raidPointsFactor, int dropsNumber, LetterType letterType, IntVec3 spawnPosition)
        {
            this.invasionIsDone = true;

            // Get an indicative amount of points based on the colony wealth so it scales up well for late-game colonies.
            IncidentParms invasionParameters = IncidentMakerUtility.DefaultParmsNow(Find.Storyteller.def, IncidentCategory.ThreatBig);
            invasionParameters.faction = Faction.OfMechanoids;
            invasionParameters.raidStrategy = RaidStrategyDefOf.ImmediateAttack;
            invasionParameters.raidArrivalMode = PawnsArriveMode.EdgeDrop;
            invasionParameters.raidNeverFleeIndividual = true;
            invasionParameters.raidPodOpenDelay = 800;
            if (dropsNumber > 0)
            {
                invasionParameters.points *= (raidPointsFactor / dropsNumber);
                if (invasionParameters.points < 320)
                {
                    invasionParameters.points = 320;
                }
                for (int dropIndex = 0; dropIndex < dropsNumber; dropIndex++)
                {
                    IntVec3 dropPodSpawningPosition;
                    float squadPoint = invasionParameters.points;
                    if (spawnPosition.IsValid)
                    {
                        invasionParameters.spawnCenter = spawnPosition;
                    }
                    else
                    {
                        RCellFinder.TryFindRandomPawnEntryCell(out invasionParameters.spawnCenter);
                    }
                    List<Pawn> mechanoidsList = new List<Pawn>();
                    while (squadPoint >= PawnKindDef.Named("Scyther").combatPower)
                    {
                        bool validDropPodCellIsFound = DropCellFinder.TryFindDropSpotNear(invasionParameters.spawnCenter, out dropPodSpawningPosition, false, true);
                        if (validDropPodCellIsFound)
                        {
                            Faction faction = Faction.OfMechanoids;
                            Pawn squadMember;
                            if (Rand.Value < 0.6f)
                            {
                                squadMember = PawnGenerator.GeneratePawn(PawnKindDef.Named("Scyther"), faction);
                                squadPoint -= PawnKindDef.Named("Scyther").combatPower;
                            }
                            else
                            {
                                squadMember = PawnGenerator.GeneratePawn(PawnKindDef.Named("Centipede"), faction);
                                squadPoint -= (int)PawnKindDef.Named("Centipede").combatPower;
                            }
                            mechanoidsList.Add(squadMember);
                            DropPodUtility.MakeDropPodAt(dropPodSpawningPosition, new DropPodInfo
                            {
                                SingleContainedThing = squadMember,
                                openDelay = 800,
                                leaveSlag = true
                            });
                        }
                    }
                    StateGraph stateGraph = GraphMaker.AssaultColonyGraph(Faction.OfMechanoids, false, false);
                    BrainMaker.MakeNewBrain(Faction.OfMechanoids, stateGraph, mechanoidsList);
                }
            }
            Find.LetterStack.ReceiveLetter(eventTitle, eventText, letterType, this.Position);
        }