private IDictionary <string, object> GetSAPInfoDictionary() { return(SAPInfos.ToDictionary("si", sapInfo => { var sapdict = new Dictionary <string, object> { { k.definition, sapInfo.EntityDefault.Definition }, { k.x, sapInfo.Position.intX }, { k.y, sapInfo.Position.intY } }; return sapdict; })); }
private void DeploySAP() { var sapInfo = SAPInfos.RandomElement(); if (sapInfo == null) { return; } var sap = (SAP)_entityServices.Factory.CreateWithRandomEID(sapInfo.EntityDefault); sap.Site = this; sap.TakeOver += OnSAPTakeOver; sap.TimeOut += OnSAPTimeOut; sap.AddToZone(Zone, sapInfo.Position); const string insertCmd = "insert into intrusionsapdeploylog (siteeid,sapdefinition) values (@siteEid,@sapDefinition)"; Db.Query().CommandText(insertCmd).SetParameter("@siteEid", Eid).SetParameter("@sapDefinition", sap.Definition).ExecuteNonQuery(); Logger.Info("Intrusion started. outpost = " + Eid + " sap = " + sap.Eid + " (" + sap.ED.Name + ")"); }