public static dynamic GetHazards(HazardType hazardType) { IHazardTypeReaderBL core = new HazardTypeReaderBL(); dynamic hazard = null; try { switch (hazardType) { case HazardType.Geo: hazard = core.GetGeoHazard(); break; case HazardType.Avalanche: hazard = core.GetAvalancheHazard(); break; case HazardType.IceLayer: hazard = core.GetIceHazard(); break; case HazardType.SnowSurface: hazard = core.GetSnowHazard(); break; } } catch (Exception ex) { Console.WriteLine(ex); } return hazard; }
/// <summary> /// Callback method for the HeroController#DieFromHazard method. /// If we have a hazard respawn while in the pause menu it soft-locks the menu, so we unpause it first. /// </summary> /// <param name="orig">The original method.</param> /// <param name="self">The HeroController instance.</param> /// <param name="hazardType">The type of hazard the player dies from.</param> /// <param name="angle">The angle of entering the hazard.</param> /// <returns>An enumerator for the coroutine.</returns> private IEnumerator HeroControllerOnDieFromHazard(On.HeroController.orig_DieFromHazard orig, HeroController self, HazardType hazardType, float angle) { ImmediateUnpauseIfPaused(); return(orig(self, hazardType, angle)); }
public Hazard(HazardType hazardType, float severityAmount, Room hazardRoom) { HazardType = hazardType; SeverityAmount = severityAmount; _hazardRoom = hazardRoom; _system = _hazardRoom.GetShipSystem(); }
public virtual void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { type = hazardType; string[] strPos = (attributesTable["pos"] as string).Split(','); position = new Vector2(float.Parse(strPos[0]), float.Parse(strPos[1])); }
//----------------------------------------------------------------------- //Set new random hazard to be activated public IEnumerator SetNewHazard() { float time = Random.Range(0, m_HazardBreak); yield return(new WaitForSeconds(time)); CurrentHazard = (HazardType)Random.Range(0, m_HazardsCount); }
public Hazard GetHazard(HazardType type) { int index = (int)type; if (index >= 0 && index < list.Count) { return(list[index]); } return(null); }
public static bool IsCombinationDeadly(HazardType encounteredHazards) { bool combinationValue; if (hazardMap.TryGetValue(encounteredHazards, out combinationValue)) { return(combinationValue); } return(false); }
private void OnExecutionTriggered(IGameEvent eventparameters) { ExecutionTriggeredEventParams evtParams = (ExecutionTriggeredEventParams)eventparameters; _hazardsForExecution = evtParams.SelectedHazards; isDeadlyCombination = HazardConfiguration.IsCombinationDeadly(_hazardsForExecution); Tween walkToExecutionTween = characterTransform.DOMove(executionPosition.position, walkToExecutionDuration); walkToExecutionTween.onComplete += OnWalkToExecutionComplete; }
public void SetHazardType(HazardType hazardType) { _hazardType = hazardType; Sprite hazardSprite = Configurations.Configurations.SpriteConfiguration.GetSpriteByHazardType(hazardType); _hazardIcon.sprite = hazardSprite != null ? hazardSprite : Configurations.Configurations.SpriteConfiguration.LockIcon; if (hazardSprite == null) { SetButtonState(HazardButtonState.Locked); } }
public override string ToString() { StringBuilder __sb = new StringBuilder("TDDIHARAArtifactUnion("); bool __first = true; if (HARAPackage != null && __isset.HARAPackage) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("HARAPackage: "); __sb.Append(HARAPackage); } if (HazardTypeSystem != null && __isset.HazardTypeSystem) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("HazardTypeSystem: "); __sb.Append(HazardTypeSystem== null ? "<null>" : HazardTypeSystem.ToString()); } if (RiskParameter != null && __isset.RiskParameter) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("RiskParameter: "); __sb.Append(RiskParameter== null ? "<null>" : RiskParameter.ToString()); } if (RiskAssessment != null && __isset.RiskAssessment) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("RiskAssessment: "); __sb.Append(RiskAssessment== null ? "<null>" : RiskAssessment.ToString()); } if (HazardType != null && __isset.HazardType) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("HazardType: "); __sb.Append(HazardType== null ? "<null>" : HazardType.ToString()); } if (MalFunction != null && __isset.MalFunction) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("MalFunction: "); __sb.Append(MalFunction== null ? "<null>" : MalFunction.ToString()); } if (Hazard != null && __isset.Hazard) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("Hazard: "); __sb.Append(Hazard== null ? "<null>" : Hazard.ToString()); } __sb.Append(")"); return __sb.ToString(); }
public Sprite GetSpriteByHazardType(HazardType hazardType) { if (hazardSpriteMap == null) { CreateSpriteMap(); } Sprite returnSprite; if (hazardSpriteMap.TryGetValue(hazardType, out returnSprite)) { return(returnSprite); } return(null); }
public Sprite GetDeathSprite(HazardType deathHazard) { if (deathSpriteMap == null) { CreateDeathSpriteMap(); } Sprite returnSprite; if (deathSpriteMap.TryGetValue(deathHazard, out returnSprite)) { return(returnSprite); } return(null); }
public override void Expose(GameObject target, HazardType hazardType) { if (vulnerabilities.Contains(hazardType)) { Carryable carryable = target.GetComponent <Carryable>(); if (carryable != null) { Carrier carrier = carryable.carrier; if (carrier != null) { carrier.Drop(); } } Destroy(target); } }
private void DestroyHazard(HazardType hazardType) { for (int i = 0; i < availableSlots.Length; i++) { HazardComponent hazardComponent = availableSlots[i]; if (hazardComponent != null && hazardComponent.HazardType == hazardType) { Destroy(hazardComponent.gameObject); availableSlots[i] = null; EventManager.CallEvent(GameEvent.HazardRemoved, new HazardRemovedEventParams(hazardType)); selectedHazards &= ~hazardType; CheckButtonState(); return; } } }
private void SpawnHazard(HazardType hazardType) { for (int i = 0; i < availableSlots.Length; i++) { if (availableSlots[i] == null) { availableSlots[i] = Instantiate(hazardPrefab, selectedHazardPositions[i]); availableSlots[i].SetHazardType(hazardType); EventManager.CallEvent(GameEvent.HazardAdded, new HazardAddedEventParams(hazardType)); selectedHazards |= hazardType; CheckButtonState(); return; } } }
public bool LogHazardIdentification(HazardType hazardType, string hazardName) { bool hazardAlreadyIdentified = hazardsIdentified.Contains(hazardType); if (hazardAlreadyIdentified) { return(false); } else { hazardsIdentified.Add(hazardType); this.StartCoroutineAsync(SendStatement(hazardName)); if (hazardsIdentified.Count == totalHazardTypes) { allHazardsIdentified = true; } return(true); } }
private extern IEnumerator DieFromHazard(HazardType hazardType, float angle);
public HazardRemovedEventParams(HazardType removedHazard) { _removedHazard = removedHazard; }
public void Expose(HazardType hazardType) { vulnerabilityController.Expose(gameObject, hazardType); }
public static HazardType CreateHazardType(int ID, string hazardTypeDescription, byte[] rowVersion) { HazardType hazardType = new HazardType(); hazardType.Id = ID; hazardType.HazardTypeDescription = hazardTypeDescription; hazardType.RowVersion = rowVersion; return hazardType; }
/// <summary> /// Creates a new hazard sprite /// </summary> /// <param name="position"></param> /// <param name="texture"></param> public Hazard(Vector2 position, HazardType type, float speed) { Position = position; Type = type; Velocity = new Vector2(speed, 0f); }
[MonoModIgnore] private extern IEnumerator DieFromHazard(HazardType hazardType, float angle);
public void AddToHazardTypes(HazardType hazardType) { base.AddObject("HazardTypes", hazardType); }
public RemoveHazardEventParams(HazardType hazardToRemove) { _hazardToRemove = hazardToRemove; }
public abstract void Expose(GameObject target, HazardType hazardType);
public override string ToString() { StringBuilder __sb = new StringBuilder("TDDIHazard("); bool __first = true; if (__isset.Id) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Id: "); __sb.Append(Id); } if (Name != null && __isset.Name) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Name: "); __sb.Append(Name); } if (Description != null && __isset.Description) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Description: "); __sb.Append(Description); } if (KeyValueMaps != null && __isset.KeyValueMaps) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("KeyValueMaps: "); __sb.Append(KeyValueMaps); } if (Condition != null && __isset.Condition) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Condition: "); __sb.Append(Condition); } if (HazardType != null && __isset.HazardType) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("HazardType: "); __sb.Append(HazardType == null ? "<null>" : HazardType.ToString()); } if (Measures != null && __isset.Measures) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Measures: "); __sb.Append(Measures); } if (Failures != null && __isset.Failures) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Failures: "); __sb.Append(Failures); } __sb.Append(")"); return(__sb.ToString()); }
public ExecutionTriggeredEventParams(HazardType selectedHazards) { _selectedHazards = selectedHazards; }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("TDDIHARAArtifactUnion"); oprot.WriteStructBegin(struc); TField field = new TField(); if (HARAPackage != null && __isset.HARAPackage) { field.Name = "HARAPackage"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); HARAPackage.Write(oprot); oprot.WriteFieldEnd(); } if (HazardTypeSystem != null && __isset.HazardTypeSystem) { field.Name = "HazardTypeSystem"; field.Type = TType.Struct; field.ID = 2; oprot.WriteFieldBegin(field); HazardTypeSystem.Write(oprot); oprot.WriteFieldEnd(); } if (RiskParameter != null && __isset.RiskParameter) { field.Name = "RiskParameter"; field.Type = TType.Struct; field.ID = 3; oprot.WriteFieldBegin(field); RiskParameter.Write(oprot); oprot.WriteFieldEnd(); } if (RiskAssessment != null && __isset.RiskAssessment) { field.Name = "RiskAssessment"; field.Type = TType.Struct; field.ID = 4; oprot.WriteFieldBegin(field); RiskAssessment.Write(oprot); oprot.WriteFieldEnd(); } if (HazardType != null && __isset.HazardType) { field.Name = "HazardType"; field.Type = TType.Struct; field.ID = 5; oprot.WriteFieldBegin(field); HazardType.Write(oprot); oprot.WriteFieldEnd(); } if (MalFunction != null && __isset.MalFunction) { field.Name = "MalFunction"; field.Type = TType.Struct; field.ID = 6; oprot.WriteFieldBegin(field); MalFunction.Write(oprot); oprot.WriteFieldEnd(); } if (Hazard != null && __isset.Hazard) { field.Name = "Hazard"; field.Type = TType.Struct; field.ID = 7; oprot.WriteFieldBegin(field); Hazard.Write(oprot); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public HazardAddedEventParams(HazardType addedHazard) { _addedHazard = addedHazard; }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("TDDIHazard"); oprot.WriteStructBegin(struc); TField field = new TField(); if (__isset.Id) { field.Name = "Id"; field.Type = TType.I64; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteI64(Id); oprot.WriteFieldEnd(); } if (Name != null && __isset.Name) { field.Name = "Name"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(Name); oprot.WriteFieldEnd(); } if (Description != null && __isset.Description) { field.Name = "Description"; field.Type = TType.String; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteString(Description); oprot.WriteFieldEnd(); } if (KeyValueMaps != null && __isset.KeyValueMaps) { field.Name = "KeyValueMaps"; field.Type = TType.List; field.ID = 4; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, KeyValueMaps.Count)); foreach (TDDIKeyValueMap _iter553 in KeyValueMaps) { _iter553.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (Condition != null && __isset.Condition) { field.Name = "Condition"; field.Type = TType.String; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteString(Condition); oprot.WriteFieldEnd(); } if (HazardType != null && __isset.HazardType) { field.Name = "HazardType"; field.Type = TType.Struct; field.ID = 6; oprot.WriteFieldBegin(field); HazardType.Write(oprot); oprot.WriteFieldEnd(); } if (Measures != null && __isset.Measures) { field.Name = "Measures"; field.Type = TType.List; field.ID = 7; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, Measures.Count)); foreach (TDDIAbstractMeasureRef _iter554 in Measures) { _iter554.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (Failures != null && __isset.Failures) { field.Name = "Failures"; field.Type = TType.List; field.ID = 8; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, Failures.Count)); foreach (TDDIAbstractFailureRef _iter555 in Failures) { _iter555.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
private void SetNewHazard() { currentHazard = (HazardType)Random.Range(0, m_HazardsCount); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("TDDIHazard"); oprot.WriteStructBegin(struc); TField field = new TField(); if (__isset.Id) { field.Name = "Id"; field.Type = TType.I64; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteI64(Id); oprot.WriteFieldEnd(); } if (Name != null && __isset.Name) { field.Name = "Name"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(Name); oprot.WriteFieldEnd(); } if (Description != null && __isset.Description) { field.Name = "Description"; field.Type = TType.String; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteString(Description); oprot.WriteFieldEnd(); } if (__isset.IsCitation) { field.Name = "IsCitation"; field.Type = TType.Bool; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteBool(IsCitation); oprot.WriteFieldEnd(); } if (__isset.IsAbstract) { field.Name = "IsAbstract"; field.Type = TType.Bool; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteBool(IsAbstract); oprot.WriteFieldEnd(); } if (KeyValueMaps != null && __isset.KeyValueMaps) { field.Name = "KeyValueMaps"; field.Type = TType.List; field.ID = 6; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, KeyValueMaps.Count)); foreach (TDDIKeyValueMapRef _iter690 in KeyValueMaps) { _iter690.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (CitedElement != null && __isset.CitedElement) { field.Name = "CitedElement"; field.Type = TType.Struct; field.ID = 7; oprot.WriteFieldBegin(field); CitedElement.Write(oprot); oprot.WriteFieldEnd(); } if (Condition != null && __isset.Condition) { field.Name = "Condition"; field.Type = TType.String; field.ID = 8; oprot.WriteFieldBegin(field); oprot.WriteString(Condition); oprot.WriteFieldEnd(); } if (HazardType != null && __isset.HazardType) { field.Name = "HazardType"; field.Type = TType.Struct; field.ID = 9; oprot.WriteFieldBegin(field); HazardType.Write(oprot); oprot.WriteFieldEnd(); } if (Measures != null && __isset.Measures) { field.Name = "Measures"; field.Type = TType.List; field.ID = 10; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, Measures.Count)); foreach (TDDIAbstractMeasureRef _iter691 in Measures) { _iter691.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (OutputFailure != null && __isset.OutputFailure) { field.Name = "OutputFailure"; field.Type = TType.Struct; field.ID = 11; oprot.WriteFieldBegin(field); OutputFailure.Write(oprot); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public AddHazardEventParams(HazardType hazardType) { _hazardType = hazardType; }
public void SetHazardType(HazardType hazardType) { _hazardType = hazardType; _hazardIcon.sprite = Configurations.Configurations.SpriteConfiguration.GetSpriteByHazardType(hazardType); }