public override void Start() { encounter = transform.GetComponent<Encounter>(); activatedState = 0; isNull = true; talk = transform.GetComponent<RPTalk_IcePlanet>(); salvage = transform.GetComponent<RPSalvage_IcePlanet>(); crew = transform.GetComponent<RPCrew_IcePlanet>(); }
public void addEvent(int para_questGiverCharID, int para_questReceiverCharID, ApplicationID para_activityID, Encounter para_encFullData) { //UnityEngine.Debug.LogWarning("ActivityID deprecated"); if(availableEvents == null) { availableEvents = new List<EventSlot>(); } availableEvents.Add(new EventSlot(nxtAvailableID,para_questGiverCharID,para_questReceiverCharID,para_activityID,para_encFullData)); nxtAvailableID++; }
public ContactSlot(int para_charID, CharacterStatus para_status, int para_numBioSectionsUnlocked, List<DifficultyMetaData> para_associatedDifficulties) { characterID = para_charID; status = para_status; numBioSectionsUnlocked = para_numBioSectionsUnlocked; album= new PhotoAlbum(para_charID,para_associatedDifficulties); enc = null; }
/*public EventSlot(int para_questID, int para_questGiverCharID, ActivityID para_acID, Encounter para_enc) { questID = para_questID; questGiverCharID = para_questGiverCharID; acID = para_acID; enc = para_enc; }*/ public EventSlot(int para_questID, int para_questGiverCharID, int para_questReceiverCharID, ApplicationID para_acID, Encounter para_enc) { questID = para_questID; questGiverCharID = para_questGiverCharID; questReceiverCharID = para_questReceiverCharID; //acID = null; enc = para_enc; }
///<summary>Converts a DataTable to a list of objects.</summary> public static List<Encounter> TableToList(DataTable table){ List<Encounter> retVal=new List<Encounter>(); Encounter encounter; for(int i=0;i<table.Rows.Count;i++) { encounter=new Encounter(); encounter.EncounterNum = PIn.Long (table.Rows[i]["EncounterNum"].ToString()); encounter.PatNum = PIn.Long (table.Rows[i]["PatNum"].ToString()); encounter.ProvNum = PIn.Long (table.Rows[i]["ProvNum"].ToString()); encounter.CodeValue = PIn.String(table.Rows[i]["CodeValue"].ToString()); encounter.CodeSystem = PIn.String(table.Rows[i]["CodeSystem"].ToString()); encounter.Note = PIn.String(table.Rows[i]["Note"].ToString()); encounter.DateEncounter= PIn.Date (table.Rows[i]["DateEncounter"].ToString()); retVal.Add(encounter); } return retVal; }
public void OpenScreen(Encounter newEncounter, PartyMember[] team) { missionOngoing = true; GetComponent<Canvas>().enabled = true; playedEncounter=newEncounter; rewardDisplayer.EnableDisplayer(this,newEncounter); roomChoiceDisplayer.EnableDisplayer(this, newEncounter); characterManager.EnableCharacterManager(combatManager); characterManager.SpawnMercsOnMissionStart(team); prepManager.EnablePrepDisplayer(combatManager, characterManager, uiToggler, modeTextDisplayer); combatCardTargeter.EnableCombatCardTargeter(combatManager, characterManager, uiToggler, modeTextDisplayer); aiCardSelector.EnableCombatCardSelector(combatManager); uiToggler.EnableUIToggler(this,combatManager); combatManager.EnableCombatManager(this, characterManager, uiToggler, prepManager, modeTextDisplayer, combatCardTargeter, aiCardSelector); ProgressThroughEncounter(); }
///<summary>Inserts one Encounter into the database. Returns the new priKey.</summary> public static long Insert(Encounter encounter){ if(DataConnection.DBtype==DatabaseType.Oracle) { encounter.EncounterNum=DbHelper.GetNextOracleKey("encounter","EncounterNum"); int loopcount=0; while(loopcount<100){ try { return Insert(encounter,true); } catch(Oracle.DataAccess.Client.OracleException ex){ if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){ encounter.EncounterNum++; loopcount++; } else{ throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return Insert(encounter,false); } }
public static async Task <bool> GetRankingData(ClassJob job, Encounter enc, string apiKey) { try { Logger.Log(LogLevel.Info, "Starting Parse Data For: " + job.Name + " Encounter " + enc.Name); var currentTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); var startTime = percentileData.LastUpdated != 0 ? percentileData.LastUpdated : new DateTimeOffset(DateTime.Now.Subtract(TimeSpan.FromDays(500))).ToUnixTimeMilliseconds(); var rankings = new List <double>(); var hasMorePages = true; var page = 1; while (hasMorePages) { var request = WebRequest.Create(string.Format( "https://www.fflogs.com:443/v1/rankings/encounter/{0}?spec={1}&page={2}&filter=date.{3}.{4}&api_key=" + apiKey, enc.Key, job.Key, page, startTime, currentTime)); request.Timeout = 5000; var response = await request.GetResponseAsync(); using (var reader = new StreamReader(response.GetResponseStream())) { var json = reader.ReadToEnd(); var rankingObj = JObject.Parse(json); if (rankingObj.HasValues) { var count = rankingObj["count"].ToObject <int>(); hasMorePages = rankingObj["hasMorePages"].ToObject <bool>(); var rankingArray = rankingObj["rankings"].ToObject <JArray>(); if (rankingArray.HasValues) { foreach (var ranking in rankingArray) { rankings.Add(ranking["total"].ToObject <double>()); } } } } Thread.Sleep(250); Logger.Log(LogLevel.Info, "Successfully Read Page: " + page); ++page; } Logger.Log(LogLevel.Info, "Successfully Read " + rankings.Count + " Rankings."); var name = enc.Name.ToLower(); if (percentileData.Rankings.ContainsKey(name) != true) { percentileData.Rankings.Add(name, new Dictionary <string, List <double> >()); if (percentileData.Rankings[name].ContainsKey(job.Abbrveiation) != true) { percentileData.Rankings[name].Add(job.Abbrveiation, new List <double>()); } } percentileData.Rankings[name][job.Abbrveiation].AddRange(rankings); Logger.Log(LogLevel.Info, "Success For Job " + job.Name + " Encounter " + enc.Name); return(await Task.FromResult(true)); } catch (WebException ex) { Logger.Log(LogLevel.Warn, ex.Message); Logger.Log(LogLevel.Warn, "No Data Exists for that Encounter and Job."); return(await Task.FromResult(true)); } }
public static Encounter CreateEncounter(int ID, string name) { Encounter encounter = new Encounter(); encounter.Id = ID; encounter.Name = name; return encounter; }
public void addEvent(int para_questGiverID, int para_questReceiverID,ApplicationID para_acID, Encounter para_encFullData) { events.addEvent(para_questGiverID, para_questReceiverID, para_acID,para_encFullData); }
///<summary>Updates one Encounter in the database.</summary> public static void Update(Encounter encounter){ string command="UPDATE encounter SET " +"PatNum = "+POut.Long (encounter.PatNum)+", " +"ProvNum = "+POut.Long (encounter.ProvNum)+", " +"CodeValue = '"+POut.String(encounter.CodeValue)+"', " +"CodeSystem = '"+POut.String(encounter.CodeSystem)+"', " +"Note = '"+POut.String(encounter.Note)+"', " +"DateEncounter= "+POut.Date (encounter.DateEncounter)+" " +"WHERE EncounterNum = "+POut.Long(encounter.EncounterNum); Db.NonQ(command); }
/*changes the iniative order of the character passed. This is done by swapping the iniativeScore of the * character passed with either the character below or above it, which is passed via the direction variable. * It the character is at the top of the list, and moved up then the character is moved to the bottom of the list. * The opposite occurs if the character is at the bottom of the list. */ public ActionResult ChangeInitiative(int characterId, string direction, string encounterJSON) { const string MOVE_UP = "up"; const string MOVE_DOWN = "down"; Encounter encounter = Newtonsoft.Json.JsonConvert.DeserializeObject <Encounter>(encounterJSON); List <Character> characters = encounter.Characters.OrderByDescending(c => c.IniativeScore).ToList(); //if there is one character in the encounter, don't do anything...just return the encounter as is //we don't need to change the initiative of one person if (characters.Count <= 1) { TempData["encounter"] = Newtonsoft.Json.JsonConvert.SerializeObject(encounter); return(RedirectToAction("Details", "Encounter")); } Character movedCharacter = encounter.Characters.Where(c => c.Id == characterId).SingleOrDefault(); //move character up if (direction == MOVE_UP) { //detect if character is at the top of the list if (movedCharacter.Id != characters.FirstOrDefault().Id) { short tempInitiativeScore = movedCharacter.IniativeScore; int movedCharacterIndex = characters.IndexOf(movedCharacter); movedCharacter.IniativeScore = characters[movedCharacterIndex - 1].IniativeScore; characters[movedCharacterIndex - 1].IniativeScore = tempInitiativeScore; if (characters[movedCharacterIndex - 1].Turn == true) { characters[movedCharacterIndex - 1].Turn = false; movedCharacter.Turn = true; } } else { for (int i = 1; i < characters.Count; i++) { short tempInitiativeScore = movedCharacter.IniativeScore; movedCharacter.IniativeScore = characters[i].IniativeScore; characters[i].IniativeScore = tempInitiativeScore; } if (movedCharacter.Turn == true) { int movedCharacterIndex = characters.IndexOf(movedCharacter); movedCharacter.Turn = false; characters[movedCharacterIndex + 1].Turn = true; } } } else if (direction == MOVE_DOWN) { if (movedCharacter.Id != characters.LastOrDefault().Id) { short tempInitiativeScore = movedCharacter.IniativeScore; int movedCharacterIndex = characters.IndexOf(movedCharacter); movedCharacter.IniativeScore = characters[movedCharacterIndex + 1].IniativeScore; characters[movedCharacterIndex + 1].IniativeScore = tempInitiativeScore; if (movedCharacter.Turn == true) { movedCharacter.Turn = false; characters[movedCharacterIndex + 1].Turn = true; } } else { for (int i = characters.Count - 2; i >= 0; i--) { short tempInitiativeScore = movedCharacter.IniativeScore; movedCharacter.IniativeScore = characters[i].IniativeScore; characters[i].IniativeScore = tempInitiativeScore; } } } encounter.Characters = characters; TempData["encounter"] = Newtonsoft.Json.JsonConvert.SerializeObject(encounter); return(RedirectToAction("Details")); }
public override void OnDoubleClick(Mobile m) { if (IsChildOf(m.Backpack) && Tree != null) { m.SendLocalizedMessage(1010086); // What do you want to use this on? m.BeginTarget(10, false, Server.Targeting.TargetFlags.None, (from, targeted) => { _Thrown = true; if (targeted is ShadowguardCypress || targeted is ShadowguardCypress.ShadowguardCypressFoilage) { ShadowguardCypress tree = null; if (targeted is ShadowguardCypress) { tree = targeted as ShadowguardCypress; } else if (targeted is ShadowguardCypress.ShadowguardCypressFoilage) { tree = ((ShadowguardCypress.ShadowguardCypressFoilage)targeted).Tree; } if (tree != null) { Point3D p = tree.Location; Map map = tree.Map; from.Animate(31, 7, 1, true, false, 0); m.MovingParticles(tree, this.ItemID, 10, 0, false, true, 0, 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0); Timer.DelayCall(TimeSpan.FromSeconds(.7), () => { if (tree.IsOppositeVirtue(Tree.VirtueType)) { tree.Delete(); Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(p, map, 0x243); m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156213, m.NetState); // *Your throw releases powerful magics and destroys the tree!* if (Tree != null) { p = Tree.Location; Tree.Delete(); Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(p, map, 0x243); //TODO: Get sound } tree.Encounter.CheckEncounter(); Delete(); } else if (Encounter != null) { foreach (var pm in Encounter.Region.GetEnumeratedMobiles().OfType <PlayerMobile>()) { if (!pm.Alive) { continue; } p = pm.Location; var creature = new VileTreefellow(); for (int i = 0; i < 10; i++) { int x = Utility.RandomMinMax(p.X - 1, p.X + 1); int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1); int z = p.Z; if (map.CanSpawnMobile(x, y, z)) { p = new Point3D(x, y, z); break; } } creature.MoveToWorld(p, map); Timer.DelayCall(() => creature.Combatant = pm); Encounter.AddSpawn(creature); } m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156212, m.NetState); // *Your throw seems to have summoned an ambush!* Delete(); } }); } } }); } }
private void UpdateEncounter(DateTime timestamp) { if (currentEncounter == null || currentEncounter.IsEncounterEnded(timestamp)) { currentEncounter = new Encounter(timestamp); Encounters.Add(currentEncounter); } }
///<summary>Inserts one Encounter into the database. Provides option to use the existing priKey.</summary> public static long Insert(Encounter encounter,bool useExistingPK){ if(!useExistingPK && PrefC.RandomKeys) { encounter.EncounterNum=ReplicationServers.GetKey("encounter","EncounterNum"); } string command="INSERT INTO encounter ("; if(useExistingPK || PrefC.RandomKeys) { command+="EncounterNum,"; } command+="PatNum,ProvNum,CodeValue,CodeSystem,Note,DateEncounter) VALUES("; if(useExistingPK || PrefC.RandomKeys) { command+=POut.Long(encounter.EncounterNum)+","; } command+= POut.Long (encounter.PatNum)+"," + POut.Long (encounter.ProvNum)+"," +"'"+POut.String(encounter.CodeValue)+"'," +"'"+POut.String(encounter.CodeSystem)+"'," +"'"+POut.String(encounter.Note)+"'," + POut.Date (encounter.DateEncounter)+")"; if(useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { encounter.EncounterNum=Db.NonQ(command,true); } return encounter.EncounterNum; }
///<summary>Updates one Encounter in the database. Uses an old object to compare to, and only alters changed fields. This prevents collisions and concurrency problems in heavily used tables.</summary> public static void Update(Encounter encounter,Encounter oldEncounter){ string command=""; if(encounter.PatNum != oldEncounter.PatNum) { if(command!=""){ command+=",";} command+="PatNum = "+POut.Long(encounter.PatNum)+""; } if(encounter.ProvNum != oldEncounter.ProvNum) { if(command!=""){ command+=",";} command+="ProvNum = "+POut.Long(encounter.ProvNum)+""; } if(encounter.CodeValue != oldEncounter.CodeValue) { if(command!=""){ command+=",";} command+="CodeValue = '"+POut.String(encounter.CodeValue)+"'"; } if(encounter.CodeSystem != oldEncounter.CodeSystem) { if(command!=""){ command+=",";} command+="CodeSystem = '"+POut.String(encounter.CodeSystem)+"'"; } if(encounter.Note != oldEncounter.Note) { if(command!=""){ command+=",";} command+="Note = '"+POut.String(encounter.Note)+"'"; } if(encounter.DateEncounter != oldEncounter.DateEncounter) { if(command!=""){ command+=",";} command+="DateEncounter = "+POut.Date(encounter.DateEncounter)+""; } if(command==""){ return; } command="UPDATE encounter SET "+command +" WHERE EncounterNum = "+POut.Long(encounter.EncounterNum); Db.NonQ(command); }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } if (!string.IsNullOrEmpty(ResourceType)) { writer.WriteString("resourceType", (string)ResourceType !); } ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false); if ((Identifier != null) && (Identifier.Count != 0)) { writer.WritePropertyName("identifier"); writer.WriteStartArray(); foreach (Identifier valIdentifier in Identifier) { valIdentifier.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Status)) { writer.WriteString("status", (string)Status !); } if (_Status != null) { writer.WritePropertyName("_status"); _Status.SerializeJson(writer, options); } if ((Modality != null) && (Modality.Count != 0)) { writer.WritePropertyName("modality"); writer.WriteStartArray(); foreach (Coding valModality in Modality) { valModality.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (Subject != null) { writer.WritePropertyName("subject"); Subject.SerializeJson(writer, options); } if (Encounter != null) { writer.WritePropertyName("encounter"); Encounter.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Started)) { writer.WriteString("started", (string)Started !); } if (_Started != null) { writer.WritePropertyName("_started"); _Started.SerializeJson(writer, options); } if ((BasedOn != null) && (BasedOn.Count != 0)) { writer.WritePropertyName("basedOn"); writer.WriteStartArray(); foreach (Reference valBasedOn in BasedOn) { valBasedOn.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (Referrer != null) { writer.WritePropertyName("referrer"); Referrer.SerializeJson(writer, options); } if ((Interpreter != null) && (Interpreter.Count != 0)) { writer.WritePropertyName("interpreter"); writer.WriteStartArray(); foreach (Reference valInterpreter in Interpreter) { valInterpreter.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if ((Endpoint != null) && (Endpoint.Count != 0)) { writer.WritePropertyName("endpoint"); writer.WriteStartArray(); foreach (Reference valEndpoint in Endpoint) { valEndpoint.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (NumberOfSeries != null) { writer.WriteNumber("numberOfSeries", (uint)NumberOfSeries !); } if (NumberOfInstances != null) { writer.WriteNumber("numberOfInstances", (uint)NumberOfInstances !); } if (ProcedureReference != null) { writer.WritePropertyName("procedureReference"); ProcedureReference.SerializeJson(writer, options); } if ((ProcedureCode != null) && (ProcedureCode.Count != 0)) { writer.WritePropertyName("procedureCode"); writer.WriteStartArray(); foreach (CodeableConcept valProcedureCode in ProcedureCode) { valProcedureCode.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (Location != null) { writer.WritePropertyName("location"); Location.SerializeJson(writer, options); } if ((ReasonCode != null) && (ReasonCode.Count != 0)) { writer.WritePropertyName("reasonCode"); writer.WriteStartArray(); foreach (CodeableConcept valReasonCode in ReasonCode) { valReasonCode.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if ((ReasonReference != null) && (ReasonReference.Count != 0)) { writer.WritePropertyName("reasonReference"); writer.WriteStartArray(); foreach (Reference valReasonReference in ReasonReference) { valReasonReference.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if ((Note != null) && (Note.Count != 0)) { writer.WritePropertyName("note"); writer.WriteStartArray(); foreach (Annotation valNote in Note) { valNote.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Description)) { writer.WriteString("description", (string)Description !); } if (_Description != null) { writer.WritePropertyName("_description"); _Description.SerializeJson(writer, options); } if ((Series != null) && (Series.Count != 0)) { writer.WritePropertyName("series"); writer.WriteStartArray(); foreach (ImagingStudySeries valSeries in Series) { valSeries.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (includeStartObject) { writer.WriteEndObject(); } }
public void setEncounterForCharacter(Encounter para_enc) { enc = para_enc; }
//private Encounter _encounter; public DamageEntityCommand(Encounter enc) { _encounter = enc; }
void IGarrison.LeaveEncounterAsSpectator(Encounter encounter) { this.ExternalEncounters.Remove(encounter); }
public override int GetHashCode() { int hash = 1; if (PokemonId != 0) { hash ^= PokemonId.GetHashCode(); } if (ModelScale != 0F) { hash ^= ModelScale.GetHashCode(); } if (Type != 0) { hash ^= Type.GetHashCode(); } if (Type2 != 0) { hash ^= Type2.GetHashCode(); } if (camera_ != null) { hash ^= Camera.GetHashCode(); } if (encounter_ != null) { hash ^= Encounter.GetHashCode(); } if (stats_ != null) { hash ^= Stats.GetHashCode(); } hash ^= quickMoves_.GetHashCode(); hash ^= cinematicMoves_.GetHashCode(); hash ^= animationTime_.GetHashCode(); hash ^= evolutionIds_.GetHashCode(); if (EvolutionPips != 0) { hash ^= EvolutionPips.GetHashCode(); } if (Rarity != 0) { hash ^= Rarity.GetHashCode(); } if (PokedexHeightM != 0F) { hash ^= PokedexHeightM.GetHashCode(); } if (PokedexWeightKg != 0F) { hash ^= PokedexWeightKg.GetHashCode(); } if (ParentPokemonId != 0) { hash ^= ParentPokemonId.GetHashCode(); } if (HeightStdDev != 0F) { hash ^= HeightStdDev.GetHashCode(); } if (WeightStdDev != 0F) { hash ^= WeightStdDev.GetHashCode(); } if (KmDistanceToHatch != 0F) { hash ^= KmDistanceToHatch.GetHashCode(); } if (FamilyId != 0) { hash ^= FamilyId.GetHashCode(); } if (CandyToEvolve != 0) { hash ^= CandyToEvolve.GetHashCode(); } if (KmBuddyDistance != 0F) { hash ^= KmBuddyDistance.GetHashCode(); } if (BuddySize != 0) { hash ^= BuddySize.GetHashCode(); } if (ModelHeight != 0F) { hash ^= ModelHeight.GetHashCode(); } hash ^= evolutionBranch_.GetHashCode(); return(hash); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationAdministration; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationAdministrationStatus>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Practitioner != null) { dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Prescription != null) { dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); } if (WasNotGivenElement != null) { dest.WasNotGivenElement = (Hl7.Fhir.Model.FhirBoolean)WasNotGivenElement.DeepCopy(); } if (ReasonNotGiven != null) { dest.ReasonNotGiven = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotGiven.DeepCopy()); } if (ReasonGiven != null) { dest.ReasonGiven = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonGiven.DeepCopy()); } if (EffectiveTime != null) { dest.EffectiveTime = (Hl7.Fhir.Model.Element)EffectiveTime.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.Element)Medication.DeepCopy(); } if (Device != null) { dest.Device = new List <Hl7.Fhir.Model.ResourceReference>(Device.DeepCopy()); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Dosage != null) { dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Procedure; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Procedure.ProcedureStatus>)StatusElement.DeepCopy(); } if (Category != null) { dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); } if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (NotPerformedElement != null) { dest.NotPerformedElement = (Hl7.Fhir.Model.FhirBoolean)NotPerformedElement.DeepCopy(); } if (ReasonNotPerformed != null) { dest.ReasonNotPerformed = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotPerformed.DeepCopy()); } if (BodySite != null) { dest.BodySite = new List <Hl7.Fhir.Model.CodeableConcept>(BodySite.DeepCopy()); } if (Reason != null) { dest.Reason = (Hl7.Fhir.Model.Element)Reason.DeepCopy(); } if (Performer != null) { dest.Performer = new List <Hl7.Fhir.Model.Procedure.PerformerComponent>(Performer.DeepCopy()); } if (Performed != null) { dest.Performed = (Hl7.Fhir.Model.Element)Performed.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Location != null) { dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); } if (Outcome != null) { dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); } if (Report != null) { dest.Report = new List <Hl7.Fhir.Model.ResourceReference>(Report.DeepCopy()); } if (Complication != null) { dest.Complication = new List <Hl7.Fhir.Model.CodeableConcept>(Complication.DeepCopy()); } if (FollowUp != null) { dest.FollowUp = new List <Hl7.Fhir.Model.CodeableConcept>(FollowUp.DeepCopy()); } if (Request != null) { dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); } if (Notes != null) { dest.Notes = new List <Hl7.Fhir.Model.Annotation>(Notes.DeepCopy()); } if (FocalDevice != null) { dest.FocalDevice = new List <Hl7.Fhir.Model.Procedure.FocalDeviceComponent>(FocalDevice.DeepCopy()); } if (Used != null) { dest.Used = new List <Hl7.Fhir.Model.ResourceReference>(Used.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
private void SpawnEnemy(Encounter currentEncounter) { //Calculate speed constant float enemySpeed = currentEncounter.speed; if (enemySpeed == 0.0f) { enemySpeed = defaultEnemySpeed; } enemySpeed *= difficultySpeedMultiplier; enemySpeed *= isRageMode ? rageSpeedMultiplier : 1.0f; //Calculate the spawn position and velocity based on where the enemy is going to move. Vector3 spawnPosition = new Vector3(0.0f, 0.0f, 0.0f); Vector2 enemyVelocity = new Vector2(0.0f, 0.0f); bool isFlipped = false; if (currentEncounter.movementDirection == MovementDirection.DOWN) { if (isRageMode) { spawnPosition = new Vector3(Random.Range(-3.0f, 3.0f), 14.0f, 0.0f); } else { spawnPosition = new Vector3(currentEncounter.spawnPositionOffset, 14.0f, 0.0f); } enemyVelocity = new Vector2(0.0f, -enemySpeed); } else if (currentEncounter.movementDirection == MovementDirection.LEFT_TO_RIGHT) { spawnPosition = new Vector3(-4.5f, currentEncounter.spawnPositionOffset + 8.0f, 0.0f); enemyVelocity = new Vector2(enemySpeed, 0.0f); isFlipped = true; } else if (currentEncounter.movementDirection == MovementDirection.RIGHT_TO_LEFT) { spawnPosition = new Vector3(4.5f, currentEncounter.spawnPositionOffset + 8.0f, 0.0f); enemyVelocity = new Vector2(-enemySpeed, 0.0f); } if (!currentEncounter.enemy) { currentWaveFinished = true; Debug.LogWarning("Current wave cut short, missing a gameobject for element " + currentEncounterIndex); return; } GameObject enemy = Instantiate(currentEncounter.enemy, spawnPosition, Quaternion.identity) as GameObject; enemy.GetComponent<Rigidbody2D>().velocity = enemyVelocity; if (isFlipped == true) { Vector3 theScale = enemy.transform.localScale; theScale.x *= -1; enemy.transform.localScale = theScale; } if (!enemy.GetComponent<UnderwaterMine>() && !enemy.GetComponent<Heart>()) { float offset = Random.Range(-spawnSizeOffset, spawnSizeOffset); enemy.transform.localScale *= (1.0f + offset); } if (enemy.GetComponent<Squid>()) { enemy.transform.localEulerAngles = new Vector3(0.0f, 0.0f, 180.0f); } else if (isRageMode && enemy.GetComponent<UnderwaterMine>()) { Destroy(enemy); Debug.Log("Mine prevented from spawning because of rage mode"); } }
public void Sync(Encounter entity) { throw new NotImplementedException(); }
public override void Start() { encounter = transform.GetComponent<Encounter>(); activatedState = 0; isNull = true; }
/// <summary> /// Checks if this is a raid encounter. /// </summary> /// <returns>A value indicating whether the provided encounter is a raid encounter.</returns> public static bool IsRaid(this Encounter encounter) { var category = encounter.GetEncounterCategory(); return(RaidCategories.Contains(category)); }
public bool isOneVisitNote(string docDefId, string dfn, Encounter encounter) { return false; }
public EncounterTile(Encounter encounter, string abbreviation) { Encounter = encounter; IsRevealed = false; Abbreviation = abbreviation; }
public NoteResult writeNote( string titleId, Encounter encounter, string text, string authorId, string cosignerId, string consultId, string prfId) { return null; }
private void RenderAppointments() { TableRow row; TableCell cell; HyperLink hyp; Panel pnl; Label lbl; HtmlGenericControl btn; HtmlGenericControl ul; HtmlGenericControl li; Encounter encounter = null; DateTime searchDate = Convert.ToDateTime(txtCurrentDate.Value); string activity = string.Empty; string created = string.Empty; string updated = string.Empty; foreach (var app in UnitOfWork.Repository <Appointment>().Queryable().Include("Patient").Where(a => a.AppointmentDate == searchDate && a.Cancelled == false && !a.Archived).ToList()) { row = new TableRow(); cell = new TableCell(); cell.Text = app.Patient.FullName; row.Cells.Add(cell); cell = new TableCell(); cell.Text = app.Reason; row.Cells.Add(cell); encounter = null; if (app.DNA) { activity = @"Appointment has been marked as <span class=""label label-warning"">Did Not Arrive</span>"; } else { encounter = app.GetEncounter(); if (encounter == null) { activity = @"Patient has not arrived yet..."; } else { activity = @"Patient arrived on " + encounter.EncounterDate.ToString("yyyy-MM-dd"); } } cell = new TableCell(); cell.Text = activity; row.Cells.Add(cell); created = String.Format("Created by {0} on {1} ...", "UNKNOWN", app.Created.ToString("yyyy-MM-dd")); if (app.LastUpdated != null) { updated = String.Format("Updated by {0} on {1} ...", "UNKNOWN", Convert.ToDateTime(app.LastUpdated).ToString("yyyy-MM-dd")); } else { updated = "NOT UPDATED"; } cell = new TableCell(); pnl = new Panel() { CssClass = "btn-group" }; btn = new HtmlGenericControl("button"); btn.Attributes.Add("class", "btn btn-default dropdown-toggle"); btn.Attributes.Add("data-toggle", "dropdown"); btn.Controls.Add(new Label() { Text = "Action " }); btn.Controls.Add(new Label() { CssClass = "caret" }); pnl.Controls.Add(btn); ul = new HtmlGenericControl("ul"); ul.Attributes.Add("class", "dropdown-menu pull-right"); li = new HtmlGenericControl("li"); hyp = new HyperLink() { NavigateUrl = "/Patient/PatientView.aspx?pid=" + app.Patient.Id.ToString(), Text = "View Patient" }; li.Controls.Add(hyp); ul.Controls.Add(li); // Check in if necessary encounter = app.Patient.GetEncounterForAppointment(app); if (encounter != null) { li = new HtmlGenericControl("li"); var verEncounterHyperLink = new HyperLink() { NavigateUrl = string.Format("/Encounter/ViewEncounter/{0}", encounter.Id.ToString()), Text = "View Encounter" }; li.Controls.Add(verEncounterHyperLink); ul.Controls.Add(li); } else { li = new HtmlGenericControl("li"); var addEncounterHyperLink = new HyperLink() { NavigateUrl = string.Format("/Encounter/AddEncounter?pid={0}&aid={1}&cancelRedirectUrl={2}", "0", app.Id.ToString(), "/Calendar/CalendarView.aspx"), Text = "Open Encounter" }; li.Controls.Add(addEncounterHyperLink); ul.Controls.Add(li); } // DNA menu if necessary if (app.AppointmentDate < DateTime.Today.AddDays(-3) && app.DNA == false && app.Cancelled == false && encounter == null) { li = new HtmlGenericControl("li"); hyp = new HyperLink() { NavigateUrl = "#", Text = "Did Not Arrive" }; hyp.Attributes.Add("data-toggle", "modal"); hyp.Attributes.Add("data-target", "#appointmentModal"); hyp.Attributes.Add("data-id", app.Id.ToString()); hyp.Attributes.Add("data-evt", "dna"); hyp.Attributes.Add("data-date", app.AppointmentDate.ToString("yyyy-MM-dd")); hyp.Attributes.Add("data-reason", app.Reason); hyp.Attributes.Add("data-cancelled", app.Cancelled ? "Yes" : "No"); hyp.Attributes.Add("data-cancelledreason", app.CancellationReason); hyp.Attributes.Add("data-created", created); hyp.Attributes.Add("data-updated", updated); li.Controls.Add(hyp); ul.Controls.Add(li); } pnl.Controls.Add(ul); cell.Controls.Add(pnl); row.Cells.Add(cell); dt_basic.Rows.Add(row); } if (dt_basic.Rows.Count == 1) { spnNoRows.InnerText = "No matching records found..."; spnNoRows.Visible = true; spnRows.Visible = false; } else { spnRows.InnerText = (dt_basic.Rows.Count - 1).ToString() + " row(s) matching criteria found..."; spnRows.Visible = true; spnNoRows.Visible = false; } }
public bool isOneVisitNote(AbstractConnection cxn, string docDefId, string pid, Encounter encounter) { return ((INoteDao)cxn.getDao(DAO_NAME)).isOneVisitNote(docDefId, pid, encounter); }
public static async Task <bool> BuildInstances(string apiKey) { if (instances != null) { instances.Clear(); // safety net that should never be needed } else { instances = new List <Instance>(); } try { var request = WebRequest.Create("https://www.fflogs.com:443/v1/zones?api_key=" + apiKey); var response = await request.GetResponseAsync(); if (response.GetResponseStream() != null) { using (var reader = new StreamReader(response.GetResponseStream() ?? throw new InvalidOperationException())) { var json = reader.ReadToEnd(); var array = JArray.Parse(json); if (array.HasValues) { foreach (var category in array) { if (category["frozen"].ToObject <bool>() == false && category["id"].ToObject <int>() != 2 && category["id"].ToObject <int>() != 14) { foreach (var encounter in category["encounters"]) { var encObj = new Encounter(); encObj.Name = category["id"].ToObject <int>() == 21 || category["id"].ToObject <int>() == 25 ? encounter["name"].ToObject <string>() + " (Savage)" : encounter["name"].ToObject <string>(); encObj.Key = encounter["id"].ToObject <int>(); encObj.Category = category["id"].ToObject <int>(); var instance = instances.FirstOrDefault(i => i.MapName == Instance.InstanceFromBoss(encObj.Name)); if (instance == null) { instance = new Instance(); instance.MapName = Instance.InstanceFromBoss(encObj.Name); instance.Encounters = new Dictionary <string, Encounter>(); instances.Add(instance); } instance.Encounters.Add(encObj.Name, encObj); Logger.Log(LogLevel.Info, string.Format("Parsed Encounter: {0} From Instance: {1}.", encObj.Name, instance.MapName)); } } } } } } return(await Task.FromResult(true)); } catch (InvalidOperationException invalidOperation) { Logger.Log(LogLevel.Fatal, "Invalid Operation Occurred, Response Stream for Instances/Zones is null."); Logger.Log(LogLevel.Fatal, invalidOperation.ToString()); return(await Task.FromResult(false)); } catch (Exception ex) { Logger.Log(LogLevel.Fatal, ex.ToString()); return(await Task.FromResult(false)); } }
public NoteResult writeNote( AbstractConnection cxn, string titleId, Encounter encounter, string text, string authorId, string cosignerId, string consultId, string prfId) { return ((INoteDao)cxn.getDao(DAO_NAME)).writeNote( titleId, encounter, text, authorId, cosignerId, consultId, prfId); }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } if (!string.IsNullOrEmpty(ResourceType)) { writer.WriteString("resourceType", (string)ResourceType !); } ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false); if ((Identifier != null) && (Identifier.Count != 0)) { writer.WritePropertyName("identifier"); writer.WriteStartArray(); foreach (Identifier valIdentifier in Identifier) { valIdentifier.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Status)) { writer.WriteString("status", (string)Status !); } if (_Status != null) { writer.WritePropertyName("_status"); _Status.SerializeJson(writer, options); } if ((Category != null) && (Category.Count != 0)) { writer.WritePropertyName("category"); writer.WriteStartArray(); foreach (CodeableConcept valCategory in Category) { valCategory.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (Code != null) { writer.WritePropertyName("code"); Code.SerializeJson(writer, options); } if (Subject != null) { writer.WritePropertyName("subject"); Subject.SerializeJson(writer, options); } if (Period != null) { writer.WritePropertyName("period"); Period.SerializeJson(writer, options); } if (Encounter != null) { writer.WritePropertyName("encounter"); Encounter.SerializeJson(writer, options); } if (Author != null) { writer.WritePropertyName("author"); Author.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }
public void getVisitString() { Encounter x = new Encounter(); x.LocationId = "my location id"; x.Timestamp = "20101118.140400"; x.Type = "the third kind"; Assert.AreEqual("my location id;3101118.140400;the third kind", VistaUtils.getVisitString(x)); }
public GroupInitiativeForm(Dictionary <string, List <CombatData> > combatants, Encounter enc) { this.InitializeComponent(); this.fCombatants = combatants; this.fEncounter = enc; this.update_list(); }
public void getVisitString_BadTS() { Encounter x = new Encounter(); x.LocationId = "my location id"; x.Timestamp = "hubahub"; x.Type = "the third kind"; VistaUtils.getVisitString(x); }
public EncounterTemplateWizard(List <Pair <EncounterTemplateGroup, EncounterTemplate> > templates, Encounter enc, int party_level) : base("Encounter Templates") { this.fData.Templates = templates; this.fData.PartyLevel = party_level; this.fEncounter = enc; this.fData.TabulaRasa = this.fEncounter.Count == 0; }
public static List<System.Type> GetAllPossibleRoomCards(Encounter.EncounterTypes encounterType) { List<System.Type> possibleCards = new List<System.Type>(); if (encounterType == Encounter.EncounterTypes.Wreckage) { possibleCards.Add(typeof(EngineRoom)); possibleCards.Add(typeof(CoolantRoom)); possibleCards.Add(typeof(Airlock)); possibleCards.Add(typeof(UpperDecks)); possibleCards.Add(typeof(LowerDecks)); } if (encounterType == Encounter.EncounterTypes.Ruins) { possibleCards.Add(typeof(Courtyard)); possibleCards.Add(typeof(Rooftop)); possibleCards.Add(typeof(RuinedHall)); possibleCards.Add(typeof(Armory)); possibleCards.Add(typeof(StoreRoom)); possibleCards.Add(typeof(Backdoor)); possibleCards.Add(typeof(Courtyard)); possibleCards.Add(typeof(GuardPost)); } return possibleCards; }
public void EncoderTest() { // construct an encounter var enc = new Encounter() { Scene = 31, NoEscape = true, ScriptedBattle = true, NoExp = true, MainCamera = 1, SecondaryCamera = 2, SecondaryCameraAnimation = 3 }; enc.Slots[0] = new EncounterSlot() { MonsterID = 77, Level = 6, Position = new Coords(200, 0, -2100), Enabled = true, Unknown2 = 209 }; // run it through the encoder & make sure everything's the same enc = new Encounter(enc.Encode()); Assert.Equal(31, enc.Scene); Assert.True(enc.NoEscape); Assert.True(enc.ScriptedBattle); Assert.True(enc.NoExp); Assert.False(enc.BackAttack); Assert.False(enc.NoResults); Assert.False(enc.NoVictorySequence); Assert.False(enc.ShowTimer); Assert.False(enc.StruckFirst); Assert.Equal(1, enc.MainCamera); Assert.Equal(0, enc.MainCameraAnimation); Assert.Equal(2, enc.SecondaryCamera); Assert.Equal(3, enc.SecondaryCameraAnimation); Assert.Equal(8, enc.Slots.Length); // first slot Assert.Equal(77, enc.Slots[0].MonsterID); Assert.Equal(6, enc.Slots[0].Level); Assert.Equal(200, enc.Slots[0].Position.X); Assert.Equal(0, enc.Slots[0].Position.Y); Assert.Equal(-2100, enc.Slots[0].Position.Z); Assert.True(enc.Slots[0].Enabled); Assert.False(enc.Slots[0].Hidden); Assert.False(enc.Slots[0].Unloaded); Assert.False(enc.Slots[0].Untargetable); Assert.Equal(0, enc.Slots[0].Unknown1); Assert.Equal(209, enc.Slots[0].Unknown2); Assert.Equal(0, enc.Slots[0].Unknown3); Assert.Equal(0, enc.Slots[0].Unknown4); // second slot Assert.Equal(0, enc.Slots[1].MonsterID); Assert.Equal(255, enc.Slots[1].Level); Assert.Equal(0, enc.Slots[1].Position.X); Assert.Equal(0, enc.Slots[1].Position.Y); Assert.Equal(-5700, enc.Slots[1].Position.Z); Assert.False(enc.Slots[1].Enabled); Assert.False(enc.Slots[1].Hidden); Assert.False(enc.Slots[1].Unloaded); Assert.False(enc.Slots[1].Untargetable); Assert.Equal(0, enc.Slots[1].Unknown1); Assert.Equal(0, enc.Slots[1].Unknown2); Assert.Equal(0, enc.Slots[1].Unknown3); Assert.Equal(0, enc.Slots[1].Unknown4); // third slot Assert.Equal(0, enc.Slots[2].MonsterID); Assert.Equal(255, enc.Slots[2].Level); Assert.Equal(0, enc.Slots[2].Position.X); Assert.Equal(0, enc.Slots[2].Position.Y); Assert.Equal(-5700, enc.Slots[2].Position.Z); Assert.False(enc.Slots[2].Enabled); Assert.False(enc.Slots[2].Hidden); Assert.False(enc.Slots[2].Unloaded); Assert.False(enc.Slots[2].Untargetable); Assert.Equal(0, enc.Slots[2].Unknown1); Assert.Equal(0, enc.Slots[2].Unknown2); Assert.Equal(0, enc.Slots[2].Unknown3); Assert.Equal(0, enc.Slots[2].Unknown4); // fourth slot Assert.Equal(0, enc.Slots[3].MonsterID); Assert.Equal(255, enc.Slots[3].Level); Assert.Equal(0, enc.Slots[3].Position.X); Assert.Equal(0, enc.Slots[3].Position.Y); Assert.Equal(-5700, enc.Slots[3].Position.Z); Assert.False(enc.Slots[3].Enabled); Assert.False(enc.Slots[3].Hidden); Assert.False(enc.Slots[3].Unloaded); Assert.False(enc.Slots[3].Untargetable); Assert.Equal(0, enc.Slots[3].Unknown1); Assert.Equal(0, enc.Slots[3].Unknown2); Assert.Equal(0, enc.Slots[3].Unknown3); Assert.Equal(0, enc.Slots[3].Unknown4); }
public static RoomCard GetRoomCardByType(System.Type roomCardType, Encounter parentMission) { RoomCard newRoomCard=(RoomCard)System.Activator.CreateInstance(roomCardType); newRoomCard.SetParentMission(parentMission); return newRoomCard; }
public void MergeFrom(PokemonSettings other) { if (other == null) { return; } if (other.PokemonId != 0) { PokemonId = other.PokemonId; } if (other.ModelScale != 0F) { ModelScale = other.ModelScale; } if (other.Type != 0) { Type = other.Type; } if (other.Type2 != 0) { Type2 = other.Type2; } if (other.camera_ != null) { if (camera_ == null) { camera_ = new global::POGOProtos.Settings.Master.Pokemon.CameraAttributes(); } Camera.MergeFrom(other.Camera); } if (other.encounter_ != null) { if (encounter_ == null) { encounter_ = new global::POGOProtos.Settings.Master.Pokemon.EncounterAttributes(); } Encounter.MergeFrom(other.Encounter); } if (other.stats_ != null) { if (stats_ == null) { stats_ = new global::POGOProtos.Settings.Master.Pokemon.StatsAttributes(); } Stats.MergeFrom(other.Stats); } quickMoves_.Add(other.quickMoves_); cinematicMoves_.Add(other.cinematicMoves_); animationTime_.Add(other.animationTime_); evolutionIds_.Add(other.evolutionIds_); if (other.EvolutionPips != 0) { EvolutionPips = other.EvolutionPips; } if (other.Rarity != 0) { Rarity = other.Rarity; } if (other.PokedexHeightM != 0F) { PokedexHeightM = other.PokedexHeightM; } if (other.PokedexWeightKg != 0F) { PokedexWeightKg = other.PokedexWeightKg; } if (other.ParentPokemonId != 0) { ParentPokemonId = other.ParentPokemonId; } if (other.HeightStdDev != 0F) { HeightStdDev = other.HeightStdDev; } if (other.WeightStdDev != 0F) { WeightStdDev = other.WeightStdDev; } if (other.KmDistanceToHatch != 0F) { KmDistanceToHatch = other.KmDistanceToHatch; } if (other.FamilyId != 0) { FamilyId = other.FamilyId; } if (other.CandyToEvolve != 0) { CandyToEvolve = other.CandyToEvolve; } if (other.KmBuddyDistance != 0F) { KmBuddyDistance = other.KmBuddyDistance; } if (other.BuddySize != 0) { BuddySize = other.BuddySize; } if (other.ModelHeight != 0F) { ModelHeight = other.ModelHeight; } evolutionBranch_.Add(other.evolutionBranch_); }
public void SetParentMission(Encounter parentMission) { this.parentMission = parentMission; }
protected override async Task OnInitializedAsync() { // Test case #1 // Create resources that directly referenced by the Patient resource Organization = await TestFhirClient.CreateAsync(Samples.GetJsonSample <Organization>("Organization")); string organizationReference = $"Organization/{Organization.Id}"; // Create Patient resource Patient patientToCreate = Samples.GetJsonSample <Patient>("Patient-f001"); patientToCreate.ManagingOrganization.Reference = organizationReference; patientToCreate.GeneralPractitioner = new List <ResourceReference> { new(organizationReference), }; Patient = await TestFhirClient.CreateAsync(patientToCreate); string patientReference = $"Patient/{Patient.Id}"; // Create resources that references the Patient resource Device deviceToCreate = Samples.GetJsonSample <Device>("Device-d1"); deviceToCreate.Patient = new ResourceReference(patientReference); Device = await TestFhirClient.CreateAsync(deviceToCreate); // Create Patient compartment resources Observation observationToCreate = Samples.GetJsonSample <Observation>("Observation-For-Patient-f001"); observationToCreate.Subject.Reference = patientReference; Observation = await TestFhirClient.CreateAsync(observationToCreate); Encounter encounterToCreate = Samples.GetJsonSample <Encounter>("Encounter-For-Patient-f001"); encounterToCreate.Subject.Reference = patientReference; Encounter = await TestFhirClient.CreateAsync(encounterToCreate); Appointment appointmentToCreate = Samples.GetJsonSample <Appointment>("Appointment"); appointmentToCreate.Participant = new List <Appointment.ParticipantComponent> { new() { Actor = new ResourceReference(patientReference), }, }; Appointment = await TestFhirClient.CreateAsync(appointmentToCreate); // Test case #2 // Create resources for a non-existent patient patientToCreate.Id = "non-existent-patient-id"; NonExistentPatient = await TestFhirClient.CreateAsync(patientToCreate); patientReference = $"Patient/{NonExistentPatient.Id}"; deviceToCreate.Patient = new ResourceReference(patientReference); DeviceOfNonExistentPatient = await TestFhirClient.CreateAsync(deviceToCreate); observationToCreate.Subject.Reference = patientReference; ObservationOfNonExistentPatient = await TestFhirClient.CreateAsync(observationToCreate); await TestFhirClient.DeleteAsync(NonExistentPatient); }
public EncounterTable(byte[] t) { Rates = new int[10]; Encounters = new Encounter[9][]; MinLevel = t[0]; MaxLevel = t[1]; for (int i = 0; i < Rates.Length; i++) Rates[i] = t[2 + i]; for (int i = 0; i < Encounters.Length - 1; i++) { Encounters[i] = new Encounter[10]; var ofs = 0xC + i * 4 * Encounters[i].Length; for (int j = 0; j < Encounters[i].Length; j++) { Encounters[i][j] = new Encounter(BitConverter.ToUInt32(t, ofs + 4 * j)); } } AdditionalSOS = new Encounter[6]; for (var i = 0; i < AdditionalSOS.Length; i++) { AdditionalSOS[i] = new Encounter(BitConverter.ToUInt32(t, 0x14C + 4 * i)); } Encounters[8] = AdditionalSOS; Data = (byte[])t.Clone(); }
void IGarrison.JoinEncounterAsContender(Encounter encounter) { this.Encounter = encounter; this.OnJoinEncounter(); }
protected void OnGUI() { // Styles apparently can't be copied or otherwise set up outside of OnGUI so these have to be done here. if (reinitialize) { // Set up the style reused for the character deletion button. deleteCharacterButtonStyle = new GUIStyle(GUI.skin.button); deleteCharacterButtonStyle.fixedWidth = 20; deleteCharacterButtonStyle.alignment = TextAnchor.MiddleRight; reinitialize = false; } scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); enc = EditorGUILayout.ObjectField("Obj: ", enc, typeof(Encounter), false) as Encounter; if (EditorGUI.EndChangeCheck()) { SetEncounter(enc); } EditorGUILayout.EndHorizontal(); // If we have an encounter let's draw it all out. if (enc != null) { enc.coinReward = EditorGUILayout.IntField("Coins", enc.coinReward); enc.itemReward = EditorGUILayout.ObjectField("Item", enc.itemReward, typeof(EquipmentItem), false) as EquipmentItem; int loopCounter = 0; bool endLoop = false; // Check to make sure we have our list setup and that we have at least one enemy object in the list. // Ideally I'd rather this be in the constructor of Encounter but I feel if I do that it will just cause // the Character object to be thrown out when there is actually a valid asset loaded in. if (enc.enemies == null) { enc.enemies = new List <Character> (); } if (enc.enemies.Count == 0) { enc.enemies.Add(new Character()); } while (endLoop == false) { Character ch = enc.enemies [loopCounter]; string name = (ch.stats == null) ? "Empty Character" : ch.stats.name; EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); characterFadeGroups [loopCounter] = EditorGUILayout.Foldout(characterFadeGroups [loopCounter], name); if (EditorGUI.EndChangeCheck()) { //characterFadeGroups[loopCounter] = characterFoldouts[loopCounter] ? 1 : 0; AnimatorTransitionInfo info; } GUILayout.Button("X", deleteCharacterButtonStyle); EditorGUILayout.EndHorizontal(); if (EditorGUILayout.BeginFadeGroup(characterFadeGroups [loopCounter] ? 1 : 0)) { EditorGUI.indentLevel++; EditorGUI.BeginChangeCheck(); ch.stats = EditorGUILayout.ObjectField("Stats", ch.stats, typeof(CharacterStatSet), false) as CharacterStatSet; if (EditorGUI.EndChangeCheck()) { if (ch.stats != null) { ch.gear.CopyFrom(ch.stats.defaultEquipment); } else { ch.gear.Clear(); } } if (ch.stats != null) { for (int i = 0; i < 7; i++) { EquipmentSlot slot; string label; switch (i) { case 0: slot = ch.gear.hand; label = "Hand"; break; case 1: slot = ch.gear.torso; label = "Torso"; break; case 2: slot = ch.gear.neck; label = "Neck"; break; case 3: slot = ch.gear.head; label = "Head"; break; case 4: slot = ch.gear.back; label = "Back"; break; case 5: slot = ch.gear.legs; label = "Legs"; break; case 6: slot = ch.gear.offHand; label = "OffHand"; break; default: slot = ch.gear.offHand; label = "Head"; break; } slot.item = EditorGUILayout.ObjectField(label, slot.item, typeof(EquipmentItem), false) as EquipmentItem; } } EditorGUI.indentLevel--; } EditorGUILayout.EndFadeGroup(); loopCounter++; if (loopCounter >= enc.enemies.Count) { endLoop = true; } } } EditorGUILayout.EndScrollView(); }
public void Sync(IEnumerable <Encounter> encounters, Patient patient) { foreach (var encounter in encounters) { try { VerifyConcepts(encounter); } catch (Exception ex) { Log.Debug(ex); } if (null != encounter) { Encounter existingEncounter = null; try { existingEncounter = _uow.EncounterRepository.FindBySyncId(encounter.UuId); } catch (Exception ex) { Log.Debug($"Error Searching for encounter {encounter}"); Log.Debug(ex); } if (null != existingEncounter) { var encounterNew = Encounter.CreateFrom(encounter); try { _uow.EncounterRepository.Delete(existingEncounter.UuId); _uow.Commit(); } catch (Exception ex) { Log.Debug($"Error updating encounter {encounter}"); Log.Debug(ex); } encounterNew.PatientId = patient.Id; encounterNew.Patient = null; encounterNew.EncounterTypeId = encounter.EncounterTypeId; encounterNew.EncounterType = null; try { _uow.EncounterRepository.Save(encounterNew); _uow.Commit(); } catch (Exception ex) { Log.Debug(ex); } OnEncounterCreatedEvent( new EncounterCreated( patient, EmrService.GetVisitType(GetEncounterType(encounterNew.EncounterTypeId).IqcareId.Value), encounterNew, EmrService.GetLocation(), GetEncounterMConpcets(encounterNew.EncounterTypeId), GetLookupHts() ) ); } else { encounter.PatientId = patient.Id; encounter.Patient = null; encounter.EncounterTypeId = encounter.EncounterTypeId; encounter.EncounterType = null; foreach (var o in encounter.Observations) { o.MConcept = null; } try { _uow.EncounterRepository.Save(encounter); _uow.Commit(); } catch (Exception ex) { Log.Debug($"Error saving NEW encounter {encounter}"); Log.Debug(ex); } OnEncounterCreatedEvent( new EncounterCreated( patient, EmrService.GetVisitType(GetEncounterType(encounter.EncounterTypeId).IqcareId.Value), encounter, EmrService.GetLocation(), GetEncounterMConpcets(encounter.EncounterTypeId), GetLookupHts() ) ); } } } }
public FormEncounterEdit(Encounter encCur) { InitializeComponent(); _encCur = encCur; }
public void EnableDisplayer(CardsScreen cardsScreen, Encounter currentMission) { this.cardsScreen = cardsScreen; this.currentMission = currentMission; }
public static string getVisitString(Encounter encounter) { return(encounter.LocationId + ';' + VistaTimestamp.fromUtcString(encounter.Timestamp) + ';' + encounter.Type); }
private static List <PartnerTraceTemplateWrap> ConvertToTraceWrapperClass(IPartnerTracingViewModel clientDashboardViewModel, Encounter encounter, List <CategoryItem> modes, List <CategoryItem> outcomes, List <CategoryItem> consents) { List <PartnerTraceTemplateWrap> list = new List <PartnerTraceTemplateWrap>(); var testResults = encounter.ObsPartnerTraceResults.ToList(); foreach (var r in testResults) { list.Add(new PartnerTraceTemplateWrap(clientDashboardViewModel, new PartnerTraceTemplate(r, modes, outcomes, consents))); } return(list); }
public override string ToString() { return(Encounter.ToString()); }
public EncounterViewModel() { Encounter.StartUpload(); }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } if (!string.IsNullOrEmpty(ResourceType)) { writer.WriteString("resourceType", (string)ResourceType !); } ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false); if (Identifier != null) { writer.WritePropertyName("identifier"); Identifier.SerializeJson(writer, options); } if ((BasedOn != null) && (BasedOn.Count != 0)) { writer.WritePropertyName("basedOn"); writer.WriteStartArray(); foreach (Reference valBasedOn in BasedOn) { valBasedOn.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if ((PartOf != null) && (PartOf.Count != 0)) { writer.WritePropertyName("partOf"); writer.WriteStartArray(); foreach (Reference valPartOf in PartOf) { valPartOf.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Questionnaire)) { writer.WriteString("questionnaire", (string)Questionnaire !); } if (_Questionnaire != null) { writer.WritePropertyName("_questionnaire"); _Questionnaire.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Status)) { writer.WriteString("status", (string)Status !); } if (_Status != null) { writer.WritePropertyName("_status"); _Status.SerializeJson(writer, options); } if (Subject != null) { writer.WritePropertyName("subject"); Subject.SerializeJson(writer, options); } if (Encounter != null) { writer.WritePropertyName("encounter"); Encounter.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Authored)) { writer.WriteString("authored", (string)Authored !); } if (_Authored != null) { writer.WritePropertyName("_authored"); _Authored.SerializeJson(writer, options); } if (Author != null) { writer.WritePropertyName("author"); Author.SerializeJson(writer, options); } if (Source != null) { writer.WritePropertyName("source"); Source.SerializeJson(writer, options); } if ((Item != null) && (Item.Count != 0)) { writer.WritePropertyName("item"); writer.WriteStartArray(); foreach (QuestionnaireResponseItem valItem in Item) { valItem.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (includeStartObject) { writer.WriteEndObject(); } }
public void CommentNoUserWithIdTest() { Encounter added = matchesRepo.Add(matchAvsB); serviceToTest.CommentOnEncounter(added.Id, "usernae", "a Comment"); }
public override void CleanAfterEncounter(Encounter encounter) { base.CleanAfterEncounter(encounter); }
public EncounterTile(Encounter encounter) { Encounter = encounter; IsRevealed = false; Abbreviation = encounter.Name().Substring(0, 3).ToUpper(); }
public void AddToEncounters(Encounter encounter) { base.AddObject("Encounters", encounter); }