void Start() { descriptions = GetComponent <Descriptions>(); if (camera == null) { camera = Camera.main; } if (objects.Length == 0) { Debug.LogError("No objects configured!"); } else { InitializeObjects(); CalculateCostAndR(); } if (objUIPrefab == null) { Debug.LogError("No object UI prefab configured!"); } if (mainUIPrefab == null) { Debug.LogError("No main UI prefab configured!"); } else { mainUIInst = Instantiate(mainUIPrefab); MainUIController(); } }
public bool Matches(string text, bool nameOnly) { CultureInfo Culture = CultureInfo.InvariantCulture; if (nameOnly) { return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0); } return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0 || Culture.CompareInfo.IndexOf(Source ?? "", text, CompareOptions.IgnoreCase) >= 0 || Culture.CompareInfo.IndexOf(Description ?? "", text, CompareOptions.IgnoreCase) >= 0 || Culture.CompareInfo.IndexOf(Alignment ?? "", text, CompareOptions.IgnoreCase) >= 0 || Speeds.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Senses.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Resistances.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Vulnerablities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Immunities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Languages.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || ConditionImmunities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) || Descriptions.Exists(s => s.Matches(text, nameOnly)) || Traits.Exists(s => s.Matches(text, nameOnly)) || LegendaryActions.Exists(s => s.Matches(text, nameOnly)) || Actions.Exists(s => s.Matches(text, nameOnly)) || Keywords.Exists(s => Culture.CompareInfo.IndexOf(s.Name ?? "", text, CompareOptions.IgnoreCase) >= 0)); }
/// <summary> /// This method updates the room description depending on the currentDescriptionID. /// Any script that wants to change the room description just needs to update the currentDescriptionID in the DB and this will take care of the rest. /// </summary> private void UpdateDescription(BsonDocument doc) { //we are going to do a check to see if the timer expired DateTime conditionTime = doc["ConditionTimeEnd"].ToUniversalTime(); if (conditionTime <= DateTime.UtcNow && conditionTime != DateTime.MaxValue) { BsonDocument currentCondition = Conditions.Where(c => c.AsBsonDocument["id"] == doc["CurrentCondition"].AsString).SingleOrDefault().AsBsonDocument; if (currentCondition != null) { BsonDocument nextCondition = Conditions.Where(c => c.AsBsonDocument["id"] == currentCondition["NextCondition"].AsString).SingleOrDefault().AsBsonDocument; if (nextCondition != null) { doc["CurrentCondition"] = nextCondition["id"].AsString; if (nextCondition["Duration"].AsInt32 != -1) { doc["ConditionTimeEnd"] = DateTime.UtcNow.AddMilliseconds(nextCondition["Duration"].AsInt32); } else { doc["ConditionTimeEnd"] = DateTime.MaxValue; } } } } BsonDocument currentDescription = Descriptions.Where(d => d.AsBsonDocument["id"].AsString == doc["CurrentCondition"].AsString).SingleOrDefault().AsBsonDocument; doc["Description"] = currentDescription["Description"].AsString; doc["Title"] = currentDescription["Title"].AsString; Save(doc); Description = doc["Description"].AsString; Title = doc["Title"].AsString; }
public UserInventoryAssetDescription ToSteamAssetDescription() { return(new UserInventoryAssetDescription( AppId, ClassId, InstanceId, string.IsNullOrWhiteSpace(IconUrl) ? null : ImageBaseAddress + IconUrl, string.IsNullOrWhiteSpace(IconUrlLarge) ? null : ImageBaseAddress + IconUrlLarge, Name, MarketHashName, MarketName, Type, IsTradable, IsMarketable, IsCommodity, IsCurrency, TradableRestriction, MarketableRestriction, (Descriptions?.Select(entity => entity.ToSteamAssetDescriptionEntry()).ToArray() ?? new UserInventoryAssetDescriptionEntry[0]).Concat( OwnerDescriptions?.Select(entity => entity.ToSteamAssetDescriptionEntry()).ToArray() ?? new UserInventoryAssetDescriptionEntry[0] ).ToArray(), Tags?.Select(tag => tag.ToSteamAssetDescriptionTag()).ToArray() ?? new UserInventoryAssetDescriptionTag[0], Actions?.Select(action => action.ToUserInventoryAssetDescriptionAction()).ToArray() ?? new UserInventoryAssetDescriptionAction[0] )); }
/// <inheritdoc/> public override int GetHashCode() { unchecked { int result = base.GetHashCode(); if (MinInjectorVersion != null) { result = (result * 397) ^ MinInjectorVersion.GetHashCode(); } if (Uri != null) { result = (result * 397) ^ Uri.GetHashCode(); } if (Name != null) { result = (result * 397) ^ Name.GetHashCode(); } result = (result * 397) ^ Summaries.GetSequencedHashCode(); result = (result * 397) ^ Descriptions.GetSequencedHashCode(); if (Homepage != null) { result = (result * 397) ^ Homepage.GetHashCode(); } result = (result * 397) ^ NeedsTerminal.GetHashCode(); result = (result * 397) ^ Feeds.GetSequencedHashCode(); result = (result * 397) ^ Categories.GetSequencedHashCode(); result = (result * 397) ^ Icons.GetSequencedHashCode(); result = (result * 397) ^ Elements.GetSequencedHashCode(); result = (result * 397) ^ EntryPoints.GetSequencedHashCode(); result = (result * 397) ^ CapabilityLists.GetSequencedHashCode(); return(result); } }
/// <summary> /// 可用的扩展。 /// </summary> /// <returns>扩展描述条目符集合。</returns> public IEnumerable <ExtensionDescriptorEntry> AvailableExtensions() { var entrys = Descriptions.Select(i => GetExtensionDescriptorEntry(i.Id, i.Type, i.Location)); return(entrys); }
public static void Postfix(SGBarracksDossierPanel __instance, Pilot p, Image ___portrait) { if (p == null) { return; } var tooltip = ___portrait.gameObject.GetComponent <HBSTooltip>() ?? ___portrait.gameObject.AddComponent <HBSTooltip>(); var desc = tooltip.GetText(); if (String.IsNullOrEmpty(desc)) { desc = ""; } var specDesc = Descriptions.GetPilotSpecializationsOrProgress(p); desc += specDesc; var descDef = new BaseDescriptionDef("PilotSpecs", p.Callsign, desc, null); tooltip.SetDefaultStateData(TooltipUtilities.GetStateDataFromObject(descDef)); }
/// <summary> /// Adds an entry in the control-setting map and also generates a tooltip for the setting. /// </summary> /// <param name="sectionName"> /// The name of the section. /// </param> /// <param name="setting"> /// The name of the setting. /// </param> /// <param name="control"> /// The control used to edit the setting. /// </param> /// <param name="settingsMap"> /// The settings map to add the entry in. /// </param> static public void AddMap <T>(string sectionName, Expression <Func <T> > setting, Control control, Dictionary <string, Control> settingsMap) { // Validate if (settingsMap == null) { throw new ArgumentNullException("settingsMap"); } // Get the member expression var me = (MemberExpression)setting.Body; // Get the property var prop = (PropertyInfo)me.Member; // Get the setting name by reading the property var settingName = (string)prop.GetValue(null, null); // Get the description attribute var descAttr = GetCustomAttribute <DescriptionAttribute>(prop); var desc = (descAttr != null ? descAttr.Description : string.Empty); // Set the tooltip // MainForm.Current.ToolTip.SetToolTip(control, desc); // Alternative (a little bit less obstructive) way to display help inside yellow header. // We could add settings EnableHelpTooltips=1, EnableHelpHeader=1 control.MouseHover += control_MouseEnter; control.MouseLeave += control_MouseLeave; Descriptions.Add(control, desc); // Add to the map settingsMap.Add(sectionName + settingName, control); }
public async Task <IActionResult> Edit(long id, [Bind("Id,Topic,ContactId,Description,CreatedAt,UpdatedAt")] Descriptions descriptions) { if (id != descriptions.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(descriptions); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DescriptionsExists(descriptions.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ContactId"] = new SelectList(_context.Contacts, "Id", "Name", descriptions.ContactId); return(View(descriptions)); }
/// <summary> /// Adds the localized description of the argument /// </summary> /// <param name="localeField">The locale field.</param> /// <param name="valueField">The value field.</param> internal void AddDescription(string localeField, string valueField) { Descriptions.Add(new Description() { Locale = localeField, Text = valueField }); }
public static ITask CreateForFrequency(MainModel radio, double frequency) { //InitializeTuningControls(radio); Conditions conditions = new Conditions(); conditions .Add(() => radio.WorkMode.Value == WorkModeState.Simplex) // simplex .Add(() => radio.Noise.Value == 1.0) // noise .Add(() => radio.Voltage.Value == 0) // voltage .Add(() => radio.Scale.Value == Turned.On) //scale .Add(() => radio.Power.Value == Turned.On) // power .Add(() => radio.Volume.Value == 1.0) // volume .Add(() => radio.Antenna.Value > 0.8 && radio.AntennaFixer.Value == ClampState.Fixed) // antenna .Add(() => radio.Frequency.Value.CompareInRange(frequency, DoubleExtentions.AcceptableRangeForFrequency)); Descriptions desctiptions = new Descriptions(); desctiptions .Add("Не установлен \"СИМПЛЕКС\".") .Add("Не установлена Ручка \"ШУМЫ\" влево до упора.") .Add("Не установлен Переключатель контроля напряжений в положении \"РАБОТА 1\".") .Add("Не установлены Тумблер \"ШКАЛА\" в положение \"ВКЛ\".") .Add("Не установлены Тумблер \"ПИТАНИЕ\" в положение \"ВКЛ\".") .Add("Не установлен Регулятор \"ГРОМКОСТЬ\" вправо до упора.") .Add("Не настроена антенна.") .Add("Не установлена частота."); return(new TaskModelNotSequance(conditions, desctiptions, () => InitializeTuningControls(radio))); }
// Constructor(s) public Shield(Vector2 position, int width, int height, float shieldValue, int method, int itemLevel) : base(Item.Nothing, ItemType.shield, TextureManager.shields[Globals.Randomizer.Next(0, TextureManager.shields.Count)], "", "Shield") { this.Type = ItemType.shield; if (itemLevel != -1) { this.ShieldHeal = Globals.Randomizer.Next(10 + itemLevel * 3, 15 + itemLevel * 3); this.Chance = Globals.Randomizer.Next(13 + itemLevel * 5, 24 + itemLevel * 6); } else { this.ShieldHeal = 13; this.Chance = 15; } this.ItemLevel = itemLevel; this.ShieldBar = new Bar(position, width, height, shieldValue, Color.LightBlue); this.Method = ListOfShieldMethods()[method]; this.Descriptions = new List <string>(); Descriptions.Add("A standard shield."); Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to reflect a shot."); Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to fire you current weapon when you are hit."); Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to loose energy instead of Shield/HP when you are hit."); Descriptions.Add("When you are hit, the damage is split up in five and taken over time."); Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to teleport to another location just before being hit."); Descriptions.Add("Increase damage by 1-3 every time you get hit for the remainder of the fight."); Descriptions.Add("50 % chance to reduce damage by 50 %."); this.Description = "|W|Shield: |0,0,255|" + MaxValue + "|W|\n" + "Shield heal on Match: |0,150,255|" + ShieldHeal + "|W|\n" + Descriptions[method]; }
public async Task <IActionResult> Edit(int id, [Bind("DescId,Description")] Descriptions descriptions) { if (id != descriptions.DescId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(descriptions); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DescriptionsExists(descriptions.DescId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(descriptions)); }
public void SetOption(string option, object value) { option = option.Trim().ToLower(); Tuple <string, Type> optInfo; if (Descriptions.TryGetValue(option, out optInfo)) { if (optInfo.Item2 == typeof(bool)) { bool?val; if (value is bool) { val = (bool)value; } else { if (value == null) { Options.Remove(option); return; } else { val = Utility.StringToBool(value.ToString(), null); if (val == null) { throw new Exception("Unable to interpret boolean value passed with option '" + option + "'"); } } } Options[option] = (bool)val; } else if (optInfo.Item2 == typeof(int)) { int val; if (value is int) { val = (int)value; } else { if (!Int32.TryParse(value.ToString(), out val)) { throw new Exception("Unable to interpret integer value passed with option '" + option + "'"); } } Options[option] = val; } else { Options[option] = value.ToString(); } } else { throw new Exception("Unknown option '" + option + "'"); } }
public ActionResult DescriptionDeleteConfirmed(int id) { Descriptions descriptions = db.Descriptions.Find(id); db.Descriptions.Remove(descriptions); db.SaveChanges(); return(RedirectToAction("DescriptionList")); }
/// <inheritdoc/> protected bool Equals(IconCapability other) { if (other == null) { return(false); } return(base.Equals(other) && Descriptions.UnsequencedEquals(other.Descriptions) && Icons.UnsequencedEquals(other.Icons)); }
public void AddDefendEffect(string description, Action <Attack> effect) { if (description != null) { Descriptions.Add(description); } DefendEffects.Add(effect); }
public void AddTurnEffect(string description, Action eachTurn) { if (description != null) { Descriptions.Add(description); } EachTurnEffects.Add(eachTurn); }
public ClientControlMenu(GameClient client) { Descriptions.Add(ClientControl.ListLobbies, "List lobbies"); Descriptions.Add(ClientControl.CreateLobby, "Create lobby"); Descriptions.Add(ClientControl.JoinLobby, "Join lobby"); Descriptions.Add(ClientControl.LeaveServer, "Leave server"); On(ClientControl.CreateLobby, client.InitCreateLobby); }
/// **************************************************************** /// public InnerSave /// ---------------------------------------------------------------- /// <summary> /// Stores the bindingTemplate details into the database. /// </summary> /// **************************************************************** /// internal void InnerSave(string serviceKey) { if (0 == ServiceKey.Length) { ServiceKey = serviceKey; } else { Debug.Verify(0 == String.Compare(ServiceKey, serviceKey, true), "UDDI_ERROR_INVALIDKEYPASSED_BINDINGPROJECTION", ErrorType.E_invalidKeyPassed); } if (Utility.StringEmpty(BindingKey)) { // // This is an insert so, generate a bindingkey // BindingKey = Guid.NewGuid().ToString(); } SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_save"); sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID); sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@generic", SqlDbType.VarChar, UDDI.Constants.Lengths.generic); sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt); sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint); sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@lastChange", SqlDbType.BigInt); sp.Parameters.SetString("@PUID", Context.User.ID); sp.Parameters.SetGuidFromString("@bindingKey", BindingKey); sp.Parameters.SetGuidFromString("@serviceKey", ServiceKey); sp.Parameters.SetString("@generic", Constants.Version); sp.Parameters.SetGuid("@contextID", Context.ContextID); if (null != AccessPoint) { sp.Parameters.SetShort("@URLTypeID", (short)AccessPoint.URLType); sp.Parameters.SetString("@accessPoint", AccessPoint.Value); } if (null != HostingRedirector) { sp.Parameters.SetGuidFromString("@hostingRedirector", HostingRedirector.BindingKey); } sp.Parameters.SetLong("@lastChange", DateTime.UtcNow.Ticks); sp.ExecuteNonQuery(); // // Save all contained objects. // Descriptions.Save(BindingKey, EntityType.BindingTemplate); TModelInstanceInfos.Save(BindingKey); }
public void AddEffect(string description, Action begin, Action end) { if (description != null) { Descriptions.Add(description); } BeginEffects.Add(begin); EndEffects.Add(end); }
public void UpdateSearchableKeywords() { SearchableKeywords = Title + " $$$ " + Owner + " $$$ " + (Descriptions?.Select(description => $"{description.Title} $$$ {description.Detail}").Aggregate((acc, next) => $"{acc} $$$ {next}") ?? "") + " $$$ " + LocationDetail + " $$$ " + string.Join(" $$$ ", Keywords ?? new List <string>()) + " $$$ " + $@"{(IsT1 ? "T1 $$$ T-1" : "")}" + " $$$ " + $@"{(IsAcademic ? "学術" : "")}"; }
FilterAttribute[] GetFilters(string alias) { if (!Descriptions.ContainsKey(alias) || Descriptions[alias].IsNullOrEmpty()) { return new FilterAttribute[] { new FilterAttribute(FilterType.None, DeclensionCase.NotDefind) } } ; return(Descriptions[alias]); }
internal override Expression GetDeserializerExpression(ParameterExpression readerExpression) { var anonTypeArgsExpressions = new List <Expression>(); foreach (var description in Descriptions) { anonTypeArgsExpressions.Add(description.DeserializeExpression(readerExpression)); } return(Expression.New(Type.GetTypeInfo().GetConstructor(Descriptions.Select(p => p.Type).ToArray()), anonTypeArgsExpressions)); }
public void RefreshAll() { Customers.Refresh(); Descriptions.Refresh(); Employees.Refresh(); Positions.Refresh(); Orders.Refresh(); Products.Refresh(); ProductOrders.Refresh(); }
public void SaveAll() { Customers.Save(); Descriptions.Save(); Employees.Save(); Positions.Save(); Orders.Save(); Products.Save(); ProductOrders.Save(); }
public override string ToString() { var str = $"{Index,2}" + $"{Type,60}" + $"{Count,7}"; var description = string.Join(Environment.NewLine, Descriptions.Select((x, indx) => $"- {x}")); return(str + Environment.NewLine + description); }
public void CleanNullProperties() { if (Instructor != null && Instructor.Id == null) { Instructor = null; } var toRemove = Descriptions.Where(description => description.CourseId == null).ToList(); toRemove.ForEach(d => Descriptions.Remove(d)); }
/// <inheritdoc /> public string GetFeatureDescription(T featureBit) { string description = null; if (!Descriptions.TryGetValue(featureBit, out description)) { description = null; } return(description); }
/// <inheritdoc/> public override int GetHashCode() { unchecked { int result = base.GetHashCode(); result = (result * 397) ^ Descriptions.GetUnsequencedHashCode(); result = (result * 397) ^ Icons.GetUnsequencedHashCode(); return(result); } }
public static void Add(HandleCast func, int delay, Descriptions description) { try { CastList.Add(new Tuple<HandleCast, Descriptions>(func, description), new Tuple<int, int>(delay, Environment.TickCount)); /*AutoJumpBack-Method triggered item cast*/ if (AutoJumpBackItemChosen && (description == Descriptions.BlinkDaggerCast || description == Descriptions.ForceStaffCast)) { HandleCast resetChosenItemAfterCast = delegate { AutoJumpBackItemChosen = false; }; CastList.Add(new Tuple<HandleCast, Descriptions>(resetChosenItemAfterCast, Descriptions.None), new Tuple<int, int>(delay, Environment.TickCount)); } } catch (System.ArgumentException exception) { //ignore multiple None decriptions } }
public static bool ContainsParticulatMethod(Descriptions description) { return CastList.Any(x => x.Key.Item2 == description); }
// Use this for initialization void Awake() { Score = GameObject.Find("SCORE").GetComponent<Score>(); Descriptions Descriptions = new Descriptions(); StoryTasks = Descriptions.GetStoryTasks(); StoryPhases = Descriptions.GetPhaseTitles(); RandomGuyJokes = Descriptions.GetRandomGuyJokes(); LevelOverScreen = LevelOverPopup.GetComponent<LevelOverScreen>(); Inventory = new Inventory (); // TESTING ONLY Inventory.AddToInventory("knife"); Inventory.AddToInventory("detergent"); LevelBuilder = GameObject.Find("Camera").GetComponent<LevelBuilder>(); ObjectiveScreen = GameObject.Find("Camera").GetComponent<ObjectiveScreen>(); TaskTracker = GameObject.Find ("Camera").GetComponent<TaskTracker>(); // TESTING ONLY //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); //GetRandomJokeBasedOn(Enums.Prisoner.Fatty); //GetRandomJokeBasedOn(Enums.Prisoner.Midget); //GetRandomJokeBasedOn(Enums.Prisoner.Skinny); }