private void DeleteFilesInEssence(Essence essence) { if (!Directory.Exists(essence.Path)) { Logging.LogWarning(essence.Path + " already deleted."); return; } var sb = new StringBuilder("Deleting Tempory files and directory:\n"); foreach (var file in essence.Files) { var absFineName = Path.Combine(essence.Path, file.Value); if (File.Exists(absFineName)) { File.Delete(absFineName); sb.AppendLine(absFineName); } } if (!Directory.EnumerateFiles(essence.Path).Any()) //temp dir is empty, safe to delete { Directory.Delete(essence.Path); sb.AppendLine(essence.Path); } Logging.LogInfo(sb.ToString()); }
private ICurrency EssenceToCurrency(Essence essence) { Currency.Currency currency = new Currency.Currency(); currency.Name = essence.Name; var rarityRequirement = essence.Level >= 6 ? new List <RarityOptions>() { RarityOptions.Normal, RarityOptions.Rare } : new List <RarityOptions>() { RarityOptions.Normal }; var rarityValidations = rarityRequirement.Select(x => _currencyRequirementValidator.ValidateRarity(x)).ToArray(); currency.Requirements.Add(_currencyRequirementValidator.ValidateAny(rarityValidations)); currency.CurrencyModifiers = new CurrencyModifiers(null, null, essence.ItemLevelRestriction, null, null); currency.Steps = new List <Action <Equipment, AffixManager, CurrencyModifiers> >() { _currencyStepExecutor.SetRarity(RarityOptions.Rare), _currencyStepExecutor.RemoveExplicits(ExplicitsOptions.All), _currencyStepExecutor.AddExplicitByItemClass(essence.ItemClassToMod), _currencyStepExecutor.AddExplicits(DistributionOptions.RareDistribution) }; return(currency); }
public void GenerateSimpleEditor(Essence essence) { WriteLine("using UnityEditor;"); WriteLine("using UnityEngine;"); WriteLine(string.Empty); WriteLine("[CustomEditor(typeof( " + essence.classType.FullName + " ))]"); WriteLine("public class " + essence.className + " : Editor"); WriteLine("{"); if (essence.createContent) { CreateContent(essence); } //Space WriteLine(string.Empty); PrintVariables(essence); //Space WriteLine(string.Empty); PrintOnEnableFunction(essence); //Space WriteLine(string.Empty); PrintGUIFunction(essence); PopIndent(); WriteLine("}"); }
public static int GetID(Essence essence1, Essence essence2) { int id = 0; Essence topEssence; Essence lowEssence; if (essence1.ElementCount >= essence2.ElementCount) { topEssence = essence1; lowEssence = essence2; } else { topEssence = essence2; lowEssence = essence1; } id = topEssence.EssenceId; if (topEssence.ElementCount > 1) { id <<= 4; } id |= lowEssence.EssenceId; return(id); }
public void AddEssence(Essence essence) { CurrentEssence = essence; essence.transform.position = EssenceHolder.position; CurrentEssence.gameObject.SetActive(true); CurrentEssence.transform.SetParent(EssenceHolder); }
public static Dictionary <Essence.Type, float> CalculateInteractions(Essence.Type t1, Essence.Type t2) { var final = new Dictionary <Essence.Type, float>(); Essence.Type key; bool not_none = (t2 != Essence.Type.none); foreach (Essence.Type t in System.Enum.GetValues(typeof(Essence.Type))) { key = t; final[key] = Essence.GetInteractions(t).ContainsKey(t1) ? Essence.GetEffectivityValue(Essence.GetInteractions(t)[t1]) : 1f; //Debug.Log(t1.ToString() + " - " + key + ": " + final[key]); if (not_none) { if (Essence.GetInteractions(t).ContainsKey(t2)) { final[key] *= Essence.GetEffectivityValue(Essence.GetInteractions(t)[t2]); } //Debug.Log(t2.ToString() + " - " + key + ": " + final[key]); } } return(final); }
public void DragTo(Essence essence, Point p, float seconds) { if (essence == null) { return; } //reset everything essence.force = new PointF(); essence.velocity = new PointF(); PointF dir, dist, newP, vChange; newP = p; dir = f.Dir(essence.p, p); dist = dir; //realise distance essence.p = newP; //update velocity: //change in v = d/t vChange = f.Divide(dist, seconds); essence.velocity = f.Add(essence.velocity, vChange); essence.velocity = f.Multiply(essence.velocity, friction); CorrectDistance(); }
private void Initialize(Essence essence) { Unit_To_Producers = new Dictionary <uint, uint[]>(); Unit_To_RequiredBuildings = new Dictionary <uint, uint[]>(); Research_To_Researcher = new Dictionary <uint, uint>(); Research_To_RequiredBuildings = new Dictionary <uint, uint>(); Research_To_RequiredResearch = new Dictionary <uint, uint>(); foreach (var pair in essence.UnitProducers) { Unit_To_Producers.Add(pair.Key, pair.Values.ToArray()); } foreach (var pair in essence.UnitRequiredBuildings) { Unit_To_RequiredBuildings.Add(pair.Key, pair.Values.ToArray()); } foreach (var pair in essence.ResearchProducer) { Research_To_Researcher.Add(pair.Key, pair.Value); } foreach (var pair in essence.ResearchRequiredBuildings) { Research_To_RequiredBuildings.Add(pair.Key, pair.Value); } foreach (var pair in essence.ResearchRequiredResearch) { Research_To_RequiredResearch.Add(pair.Key, pair.Value); } }
public static bool IsContainsInSynonyms (this Essence essence, List <string> inquiriesSynonyms, ICoreferenceInfo coreferenceInfo) { if (inquiriesSynonyms == null) { return(true); } if (Algorithms.IsHomogeneous(essence)) { var elements = Algorithms.GetObjectsFromHomogeneous(essence.Entity, ObjectAllocateMethod.PhysicalOrJuridicalPersons); if (elements.Contains(essence.Entity)) //(elements.Count == 1) && (elements.First() == essence.Entity) ) { elements = Algorithms.GetObjectsFromHomogeneous(essence.Entity, ObjectAllocateMethod.FirstEntityWithTypePronoun); } var essenceItems = Algorithms.ConstructEssenceItems4Homogeneous(elements, coreferenceInfo); essence.SetEssenceItems4Homogeneous(essenceItems); } foreach (var ei in essence.EssenceItems) { if (ei.IsContainsInInquiriesSynonyms(inquiriesSynonyms)) { return(true); } } return(false); }
public ActionResult GetEssenceByName(string name) { var model = new Essence(); var query = from e in dB.Essences.AsQueryable() join b in dB.BaseItems.AsQueryable() on e.Name equals b.ItemName where e.Name == name select new Essence() { Name = e.Name, Level = e.Level, LevelRestriction = (e.LevelRestriction == BsonNull.Value) ? 0 : e.LevelRestriction, SpawnLevelMin = e.SpawnLevelMin, SpawnLevelMax = e.SpawnLevelMax, IsCorruptionOnly = e.IsCorruptionOnly, Mods = e.Mods, OtherProperties = e.OtherProperties, VisualIdentity = b.VisualIdentity, }; model = query.FirstOrDefault(); SetType(model); SetImgSrc(model); return(View("GetEssence", model)); }
public bool AddEssence(Essence _essence, Point _inBlockCoords) { if (_essence is StackOfItems) { foreach (var tuple in Objects) { if (tuple.Item2 == _inBlockCoords && tuple.Item1.Equals(_essence)) { var stack = tuple.Item1 as StackOfItems; if (stack != null) { stack.Add((StackOfItems)_essence); return(false); } } } } if (_essence is IRemoteActivation) { var ra = _essence as IRemoteActivation; World.TheWorld.RegisterRemoteActivation(ra.MechanismId, ra, ToWorldCoords(_inBlockCoords)); } Objects.Add(new Tuple <Essence, Point>(_essence, _inBlockCoords)); return(true); }
public bool AddEssence(Essence _essence, Point _inBlockCoords) { if (_essence is StackOfItems) { foreach (var tuple in Objects) { if (tuple.Item2 == _inBlockCoords && tuple.Item1.Equals(_essence)) { var stack = tuple.Item1 as StackOfItems; if (stack != null) { stack.Add((StackOfItems)_essence); return false; } } } } if(_essence is IRemoteActivation) { var ra = _essence as IRemoteActivation; World.TheWorld.RegisterRemoteActivation(ra.MechanismId, ra, ToWorldCoords(_inBlockCoords)); } Objects.Add(new Tuple<Essence, Point>(_essence, _inBlockCoords)); return true; }
/// <summary> /// Abathur client is used to set up the Abathur framework. /// </summary> /// <param name="setupSettings">File containing list of modules Abathur should include</param> /// <param name="gameSettings">Settings for setting up the game with the StarCraft II client</param> /// <param name="essence">File containing data that is subject to change due to patches</param> /// <param name="log">Optional logging, will be used be the entire framework</param> public AbathurClient(AbathurSetup setupSettings, GameSettings gameSettings, Essence essence, ILogger log = null) { this.setupSettings = setupSettings; this.gameSettings = gameSettings; this.essence = essence; this.log = log; }
protected void OnEnable() { m_SelectedItem.Load(); m_SearchFilter.Load(); m_MethodName.Load(); m_MethodAssemblyQualifiedName.Load(); m_ShowUserAssemblies.Load(); m_ShowUnityAssemblies.Load(); m_CreateAnother.Load(); m_OptionsPageSelection.Load(); m_Essence = new Essence(); m_EssenceEditor = (EssenceEditor)EssenceEditor.CreateEditor(m_Essence, typeof(EssenceEditor)); m_EssenceEditor.OnEnable(); m_GeneratorNames = System.Enum.GetNames(typeof(GeneratorTypes)); for (int i = 0; i < m_GeneratorNames.Length; i++) { m_GeneratorNames[i] = ObjectNames.NicifyVariableName(m_GeneratorNames[i]); } m_Types = new List <Type>(); GetAssemblies(); PopulateTypes(); }
public async void WhenInsertVerticesConnectedWithEdgeThenAllOfItInsertedTest() { var graph = new GnomGraph(GraphSettings); await graph.Setup(); var essence = new Essence($"sample esence {Guid.NewGuid()}"); var sku = new OriginalSkuName(true, $"sample sku {Guid.NewGuid()}", null); var skuBelongsToEssence = new SkuBelongsToEssence(); using (var g = graph.Mutate()) { g.CreateVertex(essence); g.CreateVertex(sku); g.CreateEdge(sku, skuBelongsToEssence, essence); } Assert.NotNull(essence.Rid); Assert.NotNull(sku.Rid); Assert.NotNull(skuBelongsToEssence.Rid); using (var g = graph.Mutate()) { g.DeleteVertex(essence); g.DeleteVertex(sku); } }
public Essence ExtractEssence() { var extractedEssence = CurrentEssence; CurrentEssence.gameObject.SetActive(false); CurrentEssence = null; return(extractedEssence); }
private static void ReprocessEssenceItems4Homogeneous (Essence essence, ICoreferenceInfo coreferenceInfo /*, ObjectAllocateMethod objectAllocateMethod*/) { if (Algorithms.IsHomogeneous(essence)) { var essenceItems = ConstructEssenceItems4Homogeneous(essence.Entity, coreferenceInfo /*, objectAllocateMethod*/); essence.SetEssenceItems4Homogeneous(essenceItems); } }
private void Consume(EnemyProgram consumeTarget, List <DungeonTile> tempPath) { DungeonManager.instance.Wait(); Essence newEssence = Instantiate(myEssence, consumeTarget.transform.position, Quaternion.identity).GetComponent <Essence>(); newEssence.Harvest(consumeTarget); newEssence.SetCourse(tempPath, this); Invoke("AttemptConsume", consumeIntervalTime); }
public void CorrectDistance(Essence essence) { if (essence.shell == null) { return; } essence.p = essence.shell.p; }
public void RemoveEssence(Essence _item, Point _inBlockCoords) { if (!Objects.Remove(new Tuple <Essence, Point>(_item, _inBlockCoords))) { throw new ApplicationException(); } else { } }
public void HasEssenceMod() { var item = GetTestItem(); Essence essence = _essenceFactory.Essence.First(); var affix = essence.ItemClassToMod[item.ItemClass]; Assert.IsNotNull(affix); }
public void RemoveEssence(Essence _item, Point _inBlockCoords) { if (!Objects.Remove(new Tuple<Essence, Point>(_item, _inBlockCoords))) { throw new ApplicationException(); } else { } }
private void UseEssence() { activeEssenceObject = essencePool.Dequeue(); activeEssence = activeEssenceObject.GetComponent <Essence>(); activeEssence.originCore = entityCore; activeEssenceObject.transform.SetParent(null); essencePool.Enqueue(activeEssenceObject); ActionPhase(); //Sets the stats of our essence. }
public void OnReDrag() { if (droppedEssence != null && locked == false) { GetBack(); dragNDrop.OnDrag(); drag = true; _img.sprite = _defaultImg; _img.color = _defaultColor; droppedEssence = null; } gridGen.OnHexGridExport(); }
internal void Initialization(Transform _blueprintObject) //Creates the physical aspect of the blueprint and pools it for activation. Is called when picked up. { //Module //entityCore = originCore; //Sets the module's entity core to the origin entity. blueprintObject = _blueprintObject; //Essence blankEssence = Instantiate(PrefabLibrary.instance.emptyEssence); //Blank essence contains an empty gameobject with an essence script. Essence newEssence = blankEssence.GetComponent <Essence>(); BuildEssence(blankEssence); //Compile the physical side of our module. }
private void Eat(Being being, Essence essence) { env.ai.AddEatenEssence(essence.p); env.ai.AllocateEssenceToShell(being, essence); being.feeding = false; being.timer_feed = being_feed_timer_start_s; being.unsucessful_feeds_short = 0; being.unsucessful_feeds_long = 0; env.vis.PlaySound_Being_Eat(); }
public void DragTo(Essence essence, Point p) { if (essence == null) { return; } //reset everything essence.force = new PointF(); essence.velocity = new PointF(); essence.p = p; }
public void Initialize(Essence essence) { abilityDictionary = new Dictionary<uint, AbilityData>(); buffDictionary = new Dictionary<uint, BuffData>(); upgradeDictionary = new Dictionary<uint, UpgradeData>(); unitTypeDictionary = new Dictionary<uint, UnitTypeData>(); foreach (var ability in essence.Abilities) abilityDictionary.Add(ability.AbilityId, ability); foreach (var buff in essence.Buffs) buffDictionary.Add(buff.BuffId, buff); foreach (var unitType in essence.UnitTypes) unitTypeDictionary.Add(unitType.UnitId, unitType); foreach (var upgrade in essence.Upgrades) upgradeDictionary.Add(upgrade.UpgradeId, upgrade); }
public void Select(Point p, bool hover) { if (hover) { //hover select selected_hover_being = SelectBeing(p); selected_hover_essence = SelectEssence(p); } else { //select selected_being = SelectBeing(p); } }
public void OnGetBack() { //Debug.Log("clicked" + droppedEssence); if (droppedEssence != null && locked == false) { GetBack(); dragNDrop = null; droppedEssence = null; _img.sprite = _defaultImg; _img.color = _defaultColor; } gridGen.OnHexGridExport(); }
private Essence CreateEssence(EssenceJson essenceJson) { Essence essence = new Essence(); essence.FullName = essenceJson.FullName; essence.Name = essenceJson.Name; essence.RequiredLevel = (int)(essenceJson?.ItemLevelRestriction ?? 100); essence.Description = essenceItems[essenceJson.Name].Description; essence.Tier = (int)essenceJson.Type.Tier; essence.Level = (int)essenceJson.Level; essence.ItemClassToMod = _affixFactory.GetEssenceAffixes(essenceJson.Mods, (int)essenceJson.Level); return(essence); }
private void UpdateText() { CoinText.text = Coin.ToString(); PoisonText.text = Essence.ToString(); if (UpgradeCoin[UpgradeCount] != -1) { UpgradeButtonEffect.color = new Color(1, 1, 1, (float)Coin / UpgradeCoin[UpgradeCount]); } else { UpgradeButtonEffect.color = Color.white; } }
public EssenceDescriptor(Essence _essence, LiveMapCell _cell, IContainer _container, Creature _creature) { m_creature = _creature; if (_essence is IFaked) { if (_container != null) { if (_essence is Item) { _essence = _container.ResolveFakeItem(_creature, (FakedItem)_essence); } else { throw new NotImplementedException("Как так?"); } } else if(_cell!=null) { if (_essence is Item) { _essence = _cell.ResolveFakeItem(_creature, (FakedItem)_essence); } else if (_essence is Thing) { _essence = _cell.ResolveFakeThing(_creature); } } else { throw new NotImplementedException("Как так?"); } } Essence = _essence; LiveCoords = _cell!=null?_cell.LiveCoords:null; Container = _container; }
public override bool Act(Essence _target) { return true; }
public abstract bool Act(Essence _target);