static void LoadEvents() { string fileName = Path.Combine(Settings.Instance.DataPath, Settings.Instance.Server + string.Format("{0}Events.xml", Path.DirectorySeparatorChar)); if (!File.Exists(fileName)) { return; } XmlDocument doc = new XmlDocument(); lock (eventFileLock) lock (eventListLock) { using (FileStream fstream = File.OpenRead(fileName)) { using (StreamReader reader = new StreamReader(fstream)) { doc.Load(reader); XmlNode root = doc.DocumentElement; foreach (XmlNode eventNode in root.SelectNodes(@"/Events/Event")) { EventStruct eventStruct = new EventStruct(); eventStruct.EventName = eventNode.SelectSingleNode("EventName").FirstChild.Value; eventStruct.EventDate = DateTime.Parse(eventNode.SelectSingleNode("EventDate").FirstChild.Value, CultureInfo.InvariantCulture.DateTimeFormat); EventList.Add(eventStruct); } } } } }
public async Task <IActionResult> DeleteEvent(int EventId) { int userId = _authenticationInfo.ActualUser.UserId; var sqlDataBase = _stObjMap.StObjs.Obtain <SqlDefaultDatabase>(); var eventTable = _stObjMap.StObjs.Obtain <EventSchoolTable>(); using (var ctx = new SqlStandardCallContext()) { AclQueries aclQueries = new AclQueries(ctx, sqlDataBase); GroupQueries groupQueries = new GroupQueries(ctx, sqlDataBase); GroupData groupData = await groupQueries.GetIdSchoolByConnectUser(userId); if (!await aclQueries.VerifyGrantLevelByUserId(112, await aclQueries.GetAclIdBySchoolId(groupData.ParentZoneId), userId, Operator.SuperiorOrEqual)) { Result result = new Result(Status.Unauthorized, "Vous n'etes pas autorisé à utiliser cette fonctionnalité !"); return(this.CreateResult(result)); } EventStruct eventResult = await eventTable.DeleteEvent(ctx, userId, EventId); if (eventResult.Status == 1) { Result result = new Result(Status.BadRequest, "Cette évenement n'existe plus ou n'a jamais existé ! "); return(this.CreateResult(result)); } return(Ok()); } }
public static int CompareEventStructsByDate(EventStruct a, EventStruct b) { if (a.EventDate == null) { if (b.EventDate == null) { // Both null return(0); } else { // B is greater return(-1); } } else { if (b.EventDate == null) { // A is greater return(1); } else { return(a.EventDate.CompareTo(b.EventDate)); } } }
public void AddEvent(AnimatorEventType type, StateEvent action, string stateName) { int hash = Animator.StringToHash(stateName); EventStruct eventValue; if (!Events.TryGetValue(hash, out eventValue)) { Events.Add(hash, eventValue = new EventStruct()); } switch (type) { case AnimatorEventType.Enter: eventValue.EnterEvents += action; break; case AnimatorEventType.Exit: eventValue.ExitEvents += action; break; case AnimatorEventType.Running: eventValue.RunningEvents += action; break; default: throw new ArgumentOutOfRangeException("type", type, null); } }
static void Main() { var s = new EventStruct(); Bind(s); s.Property = "test"; Console.ReadKey(); }
public static void Send(string _key, EventArg _arg = null) { if (eventsMap.ContainsKey(_key)) { EventStruct tEventStruct = eventsMap[_key]; for (int i = 0; i < tEventStruct.CallbackLst.Count; i++) { tEventStruct.CallbackLst[i].DynamicInvoke(_arg); } } }
public static EventStruct GetEventByKey(string _key) { EventStruct tEventStruct = null; if (eventsMap.ContainsKey(_key)) { tEventStruct = eventsMap[_key]; } if (null == tEventStruct) { LogDebug.Log("Event Not Exist!!!"); } return(tEventStruct); }
public void MovePlayerTo(Vector3 target, float speedMove) { if (pt.position != target) { // if target not reached, move to target prb.MovePosition(Vector3.MoveTowards(pt.position, target, speedMove * Time.deltaTime)); } else { // target reached, reset target to zero targetHit = Vector3.zero; EventStruct updateEvent = EMS.EventsTracked.Find(et => et.Char == this); updateEvent.isDone = true; } }
public async Task <IActionResult> CreateEvents([FromBody] SchoolEventChangeModel model) { int userId = _authenticationInfo.ActualUser.UserId; var sqlDataBase = _stObjMap.StObjs.Obtain <SqlDefaultDatabase>(); var eventTable = _stObjMap.StObjs.Obtain <EventSchoolTable>(); using (var ctx = new SqlStandardCallContext()) { PeriodServices periodServices = new PeriodServices(); GroupQueries groupQueries = new GroupQueries(ctx, sqlDataBase); TimedPeriodQueries timedPeriodQueries = new TimedPeriodQueries(ctx, sqlDataBase); EventQueries eventQueries = new EventQueries(ctx, sqlDataBase); if (!await periodServices.CheckPeriodGivenDate(_stObjMap, _authenticationInfo, model.BegDate, model.EndDate)) { Result result = new Result(Status.BadRequest, "Ces Dates ne sont pas comprises dans la periode actuel"); return(this.CreateResult(result)); } GroupData groupData = await groupQueries.GetIdSchoolByConnectUser(userId); AclQueries aclQueries = new AclQueries(ctx, sqlDataBase); if (!await aclQueries.VerifyGrantLevelByUserId(112, await aclQueries.GetAclIdBySchoolId(groupData.ParentZoneId), userId, Operator.SuperiorOrEqual)) { Result result = new Result(Status.Unauthorized, "Vous n'etes pas autorisé à utiliser cette fonctionnalité !"); return(this.CreateResult(result)); } if (!model.IsOther) { model.Name += "-" + await timedPeriodQueries.GetGroupNameActualPeriod(groupData.ZoneId, groupData.ParentZoneId); } EventStruct eventResult = await eventTable.CreateEvent(ctx, model.Name, model.BegDate, model.EndDate, groupData.ZoneId, userId); if (eventResult.Status == 1) { Result result = new Result(Status.Unauthorized, "Cette evenement existe deja dans votre école !"); return(this.CreateResult(result)); } List <EventData> events = await eventQueries.GetAllEventsByIdSchool(groupData.ParentZoneId); return(Ok(events)); } }
public void MovePlayerBack(Vector3 target) { if (pt.position != target) { // if target not reached, move to target prb.MovePosition(Vector3.MoveTowards(pt.position, target, speed * Time.deltaTime)); targetHome = tribePos.position; targetHome.y = Cs.CharacterPlane; } else { // target reached, reset target to zero targetHome = Vector3.zero; EventStruct updateEvent = EMS.EventsTracked.Find(et => et.Char == this); updateEvent.isCharBack = true; } }
public void OpenEvent(int _event) { EventStruct newEvent = EventControl.GetEventStruct(_event); eventObject.SetActive(true); nameText.text = newEvent.name; eventText.text = newEvent.eventText; for (int i = 0; i < newEvent.buttonText.Length; i++) { buttonText [i].transform.parent.gameObject.SetActive(false); } for (int i = 0; i < newEvent.buttonText.Length; i++) { buttonText [i].transform.parent.gameObject.SetActive(true); buttonText[i].text = newEvent.buttonText[i]; } currentEvent = _event; }
public static void AddEvent(string _key, Action <EventArg> _event, Object _source) { EventStruct tEventStruct; if (eventsMap.ContainsKey(_key)) { tEventStruct = null /*GetEventById(_key)*/; if (tEventStruct.CallbackLst.Contains(_event)) { LogDebug.Log("重复添加事件"); return; } tEventStruct.CallbackLst.Add(_event); return; } tEventStruct = new EventStruct(_key, _source); tEventStruct.CallbackLst.Add(_event); eventsMap.Add(_key, tEventStruct); }
public void AddZone(GameObject Gatherzone) { switch (Gatherzone.tag) { case "Gather": //AddEvent(Gzs.type, 1, Gatherzone); GatherZoneScript Gzs = Gatherzone.GetComponent <GatherZoneScript>(); GatherZones.Add(Gzs); EventStruct ES = new EventStruct(); ES.type = Gzs.type; ES.recurrent = Gzs.recurrent; ES.nextStart = 0; ES.inUse = Gzs.isUsed; ES.Zone = Gzs; EventsTracked.Add(ES); break; default: break; } }
/// <summary> /// 订阅消息,要先定义消息数据结构 /// </summary> public static void Subscribe <T>(System.Action <T> cb) where T : KEventData { System.Type t = typeof(T); string typeName = t.FullName; EventStruct es = new EventStruct(); es.uniqueId = GetUniqueId <T>(cb); es.cb = (item) => cb((T)item); if (subscriberMap.ContainsKey(typeName)) { //不允许重复订阅 bool isAlreadyAdded = false; List <EventStruct> callbackList = subscriberMap[typeName]; for (int i = callbackList.Count - 1; i >= 0; i--) { if (callbackList[i].uniqueId.Equals(es.uniqueId)) { isAlreadyAdded = true; break; } } if (!isAlreadyAdded) { subscriberMap[typeName].Add(es); } else { Debug.LogError("not|allow|add|again|" + t + "|" + cb); } } else { subscriberMap.Add(typeName, new List <EventStruct>() { es }); } }
public int iV_GetEvent(ref EventStruct eventDataSample) { return(Unmanaged_GetEvent(ref eventDataSample)); }
static void LoadEvents() { string fileName = Path.Combine(Settings.Instance.DataPath, Settings.Instance.Server + string.Format("{0}Events.xml", Path.DirectorySeparatorChar)); if (!File.Exists(fileName)) return; XmlDocument doc = new XmlDocument(); lock (eventFileLock) lock (eventListLock) { using (FileStream fstream = File.OpenRead(fileName)) { using (StreamReader reader = new StreamReader(fstream)) { doc.Load(reader); XmlNode root = doc.DocumentElement; foreach (XmlNode eventNode in root.SelectNodes(@"/Events/Event")) { EventStruct eventStruct = new EventStruct(); eventStruct.EventName = eventNode.SelectSingleNode("EventName").FirstChild.Value; eventStruct.EventDate = DateTime.Parse(eventNode.SelectSingleNode("EventDate").FirstChild.Value, CultureInfo.InvariantCulture.DateTimeFormat); EventList.Add(eventStruct); } } } } }
public static EventStruct GetEventStruct(int _event) { EventStruct newEvent = new EventStruct(); switch (_event) { case 0: newEvent = new EventStruct( "N/A", "N/A", new string[] { "N/A" }, new EventConsequences[] { new EventConsequences() } ); break; case 1: newEvent = new EventStruct( "New Orders", "We have got reports from an observer saying they have found the information regarding the location of the tomb", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(2) } ); break; case 2: newEvent = new EventStruct( "New Orders", "You will be given a sizeable grant to find the tomb and a free reign to do so", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(3) } ); break; case 3: newEvent = new EventStruct( "New Orders", "Remember you should use us to help you find the tomb", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(4) } ); break; case 4: newEvent = new EventStruct( "New Orders", "Now go and find the tomb", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 0, 1, 2, 3, 4 }) } ); break; case 5: newEvent = new EventStruct( "Mystery Station", "As you approach the station your scanners begin to scramble", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(6) } ); break; case 6: newEvent = new EventStruct( "Mystery Station", "Through the mess your second makes out a ship", new string[] { "Scan For Signals", "Continue To Station" }, new EventConsequences[] { new EventConsequences(7), new EventConsequences(8) } ); break; case 7: newEvent = new EventStruct( "Mystery Station", "You are not able to pick up any message through the mess", new string[] { "Increase scanning" }, new EventConsequences[] { new EventConsequences(9) } ); break; case 8: newEvent = new EventStruct( "Mystery Station", "As you move towards the station your ship receives a big data transfer", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(10) } ); break; case 9: newEvent = new EventStruct( "Mystery Station", "A plip appears on the system. It turns out to be a black sphere", new string[] { "Leave it alone", "Collect the black sphere" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 1 }), new EventConsequences(0, true, new int[] { 1, 2, 4 }) } ); break; case 10: newEvent = new EventStruct( "Mystery Station", "What should you do with the transfer", new string[] { "Stop the transfer", "leave it be", "Control the data flow" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2 }), new EventConsequences(0, true, new int[] { 1, 2, 4 }, -2, 0, 0, 0), new EventConsequences(0, true, new int[] { 1, 2, 3, 4 }) } ); break; case 11: newEvent = new EventStruct( "Expedition Force", "You meet up with an expedition force on a remote outpost", new string[] { "Transfer the data", "Collect the data" }, new EventConsequences[] { new EventConsequences(12), new EventConsequences(14) } ); break; case 12: newEvent = new EventStruct( "Expedition Force", "Whilst transfering information between the ships an analyst uncovers something", new string[] { "Order a closer inspection", "Thank them for the data and leave" }, new EventConsequences[] { new EventConsequences(13), new EventConsequences(0, true, new int[] { 2, 3, 4 }) } ); break; case 13: newEvent = new EventStruct( "Expedition Force", "On deeper inspection it is realised that the information has less to give than you thought", new string[] { "Thank them for the data and leave" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2, 4 }) } ); break; case 14: newEvent = new EventStruct( "Expedition Force", "The commander of the force gives you the data that they think you want", new string[] { "Thank them for the data and leave" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 4 }) } ); break; case 15: newEvent = new EventStruct( "Radar Improvement", "Whilst improving your ships radar your techniction discovers an unkown piece of equipment", new string[] { "Setup a trap", "Remove and examine the equipment" }, new EventConsequences[] { new EventConsequences(16), new EventConsequences(20) } ); break; case 16: newEvent = new EventStruct( "Radar Improvement", "You set up a trap with the false information you fed it", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(17) } ); break; case 17: newEvent = new EventStruct( "Radar Improvement", "The trap reveals a ship following you", new string[] { "Communicate", "Enage in Combat" }, new EventConsequences[] { new EventConsequences(18), new EventConsequences(19) } ); break; case 18: newEvent = new EventStruct( "Radar Improvement", "Communications with the ship exposes that they are from a rival company tasked with the same objective as you", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 0, 2 }, 0, 100, 0, 0) } ); break; case 19: newEvent = new EventStruct( "Radar Improvement", "Engaging the ship in combat results in damage to the ship", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 1, 4 }, -3, 50, 0, 0) } ); break; case 20: newEvent = new EventStruct( "Radar Improvement", "Examining the piece of equipment gives details about who placed it", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 3 }, 0, 250, 0, 0) } ); break; case 21: newEvent = new EventStruct( "Trading Station", "You dock with the trading station after receiving reports of a valuable information", new string[] { "Meet Contact", "Send Team" }, new EventConsequences[] { new EventConsequences(22), new EventConsequences(26) } ); break; case 22: newEvent = new EventStruct( "Trading Station", "Your contact at the station tells you that what you are looking for has been taken a local gang", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(23) } ); break; case 23: newEvent = new EventStruct( "Trading Station", "As you enter the area you notice the gang members lurking around", new string[] { "Talk", "Engage" }, new EventConsequences[] { new EventConsequences(24), new EventConsequences(25) } ); break; case 24: newEvent = new EventStruct( "Trading Station", "The gang agrees to sell you the information at a very high price", new string[] { "Accept", "Decline" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 0, 2, 4 }, 0, 25, -250, 0), new EventConsequences(25) } ); break; case 25: newEvent = new EventStruct( "Trading Station", "As soon as you enter combat wih the gang they immedietely run away leaving behind the information", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 0, 2, 4 }, 2, 25, 0, 0) } ); break; case 26: newEvent = new EventStruct( "Trading Station", "You send a team to retrieve the information as you wait aboard the station", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(27) } ); break; case 27: newEvent = new EventStruct( "Trading Station", "A few hours later your team returns with a part of the information", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 1, 3 }, 0, 10, 0, 0) } ); break; case 28: newEvent = new EventStruct( "Asteroid Base", "The asteroid base that hold information you want is in radar range", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(29) } ); break; case 29: newEvent = new EventStruct( "Asteroid Base", "An automatic message repeats'Do not approach'", new string[] { "Ignore", "Listen" }, new EventConsequences[] { new EventConsequences(30), new EventConsequences(32) } ); break; case 30: newEvent = new EventStruct( "Asteroid Base", "There appers to be no visble signs of life aboard the base", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(31) } ); break; case 31: newEvent = new EventStruct( "Asteroid Base", "You secure the data and make a way back to the ship", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 0, 1, 3 }, 0, 150, 50, 0) } ); break; case 32: newEvent = new EventStruct( "Asteroid Base", "You listen to the message and leave", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] {}, 2, 25, 0, 0) } ); break; case 33: newEvent = new EventStruct( "Unkown Vessel", "Your scanners pick up an unkown vessel", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(34) } ); break; case 34: newEvent = new EventStruct( "Unkown Vessel", "The ship appears to be of unkown origin", new string[] { "Communicate", "Board" }, new EventConsequences[] { new EventConsequences(35), new EventConsequences(36) } ); break; case 35: newEvent = new EventStruct( "Unkown Vessel", "Communications with the ship fail", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(36) } ); break; case 36: newEvent = new EventStruct( "Unkown Vessel", "Your boarding party reaches the other ships and begins to search", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(37) } ); break; case 37: newEvent = new EventStruct( "Unkown Vessel", "You are told of empty cryocapsules aboard the ship", new string[] { "Investigate", "Leave" }, new EventConsequences[] { new EventConsequences(38), new EventConsequences(0, true, new int[] {}, 1, 50, 0, 0) } ); break; case 38: newEvent = new EventStruct( "Unkown Vessel", "Investigation into the capsules reveal that they have been empty for hundreds of years", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2, 3, 4 }, 1, 30, 0, 0) } ); break; case 39: newEvent = new EventStruct( "Message", "Your communicator informs you of a message being sent to you 'Help us we are un' the message ends there", new string[] { "Approach", "Send Probe", "Leave" }, new EventConsequences[] { new EventConsequences(40), new EventConsequences(43), new EventConsequences(0, true, new int[] {}, 1, 0, 0, 0) } ); break; case 40: newEvent = new EventStruct( "Message", "You aproach the signal but before being able to get visuals on the origins of the message, you crew begins to show signs of illness", new string[] { "Continue", "Leave" }, new EventConsequences[] { new EventConsequences(41), new EventConsequences(0, true, new int[] {}, 1, 15, 0, 0) } ); break; case 41: newEvent = new EventStruct( "Message", "before long all the crew are down", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(42) } ); break; case 42: newEvent = new EventStruct( "Message", "You are woken by your second who slapping you, she informs you that the ship had been pilaged by an unkown group", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 1 }, -3, -30, -250, -1) } ); break; case 43: newEvent = new EventStruct( "Message", "The probe reveals a hidden ship hidding behind a gas cloud waiting to ambush any ship that approaches", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2, 4 }, 1, 25, 0, 0) } ); break; case 44: newEvent = new EventStruct( "Beast", "Alarms begin to sound, unsure of what they are for the ship moves to battlestations", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(45) } ); break; case 45: newEvent = new EventStruct( "Beast", "You get mixed reports of something aboard the ship", new string[] { "Secure", "Hunt" }, new EventConsequences[] { new EventConsequences(46), new EventConsequences(48) } ); break; case 46: newEvent = new EventStruct( "Beast", "Your security teams locks down key sections of your ship", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(47) } ); break; case 47: newEvent = new EventStruct( "Beast", "The ship is being cleared section by section", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(49) } ); break; case 48: newEvent = new EventStruct( "Beast", "You send the security team to clear the ship section by section", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(50) } ); break; case 49: newEvent = new EventStruct( "Beast", "The beast is cornered into a section of the ship", new string[] { "Send In Team", "Flush out Into Space" }, new EventConsequences[] { new EventConsequences(51), new EventConsequences(52) } ); break; case 50: newEvent = new EventStruct( "Beast", "The beast gets cornered in the engine room and damages the engines before being taken down", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2, 3, 4 }, -3, 125, 0, 0) } ); break; case 51: newEvent = new EventStruct( "Beast", "The beast gets blown out into the vacuum of space", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 2, 3 }, -1, 20, 0, 0) } ); break; case 52: newEvent = new EventStruct( "Beast", "The beast is taken down alive with very little difficulty", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] { 1, 2, 4 }, -1, 220, 0, 0) } ); break; case 53: newEvent = new EventStruct( "Tomb", "Finally you have reached the tomb", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(54) } ); break; case 54: newEvent = new EventStruct( "Tomb", "You send a message back to HQ informing that the tomb has been found", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(55) } ); break; case 55: newEvent = new EventStruct( "Tomb", "Without waiting for a reply you order the ship to dock", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(56) } ); break; case 56: newEvent = new EventStruct( "Tomb", "Your crew is excited to explore the tomb", new string[] { "Continue" }, new EventConsequences[] { new EventConsequences(57) } ); break; case 57: newEvent = new EventStruct( "Tomb", "You lead you crew in exploration of the tomb", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, true, new int[] {}) } ); break; // Single Events case 58: newEvent = new EventStruct( "", "Your lead scientist asks if the ship can remain here for his experiment to be completed", new string[] { "Accept", "Decline" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 10, 0, 0), new EventConsequences(0, false, new int[] {}, 1, 0, 0, 0) } ); break; case 59: newEvent = new EventStruct( "", "You discover a hidden vessel inside an asteroid", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 20, 20, 1) } ); break; case 60: newEvent = new EventStruct( "", "Members of your crew are experiencing incereased intelligence", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 80, 0, 0) } ); break; case 61: newEvent = new EventStruct( "", "You receive a mysterious signal", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 20, 10, 0) } ); break; case 62: newEvent = new EventStruct( "", "Your engineers have upgraded your jump drive", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 0, 2) } ); break; case 63: newEvent = new EventStruct( "", "Your ship takes a hit from a object peircing the hull", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -5, 0, 0, 0) } ); break; case 64: newEvent = new EventStruct( "", "Your last jump caused too much stress on your ship and is causing damage", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -3, 0, 0, -1) } ); break; case 65: newEvent = new EventStruct( "", "You get lucky and find a hidden stash of units", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 50, 0) } ); break; case 66: newEvent = new EventStruct( "", "You find a stash of jump charges", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 0, 3) } ); break; case 67: newEvent = new EventStruct( "", "You find a stash of strength upgrades", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 5, 0, 0, 0) } ); break; case 68: newEvent = new EventStruct( "", "Your emplyer has sent you a sum of resources to aid you", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 1, 30, 40, 1) } ); break; case 69: newEvent = new EventStruct( "", "Your crew are beginning to get uneasy", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -2, -20, -10, 0) } ); break; case 70: newEvent = new EventStruct( "", "You head of security has asked to run a full scan on the androids in the ship", new string[] { "Accept", "Decline" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 1, -20, -10, 0), new EventConsequences(0, false, new int[] {}, -2, 20, 0, 0) } ); break; case 71: newEvent = new EventStruct( "", "Experiments by your science team reveal extra strength to the ship", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 3, 0, 0, 0) } ); break; case 72: newEvent = new EventStruct( "", "Experiments by your science team have given your ship extra jump charges", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 0, 2) } ); break; case 73: newEvent = new EventStruct( "", "Experiments by your science team give a greater insight", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 60, 0, 0) } ); break; case 74: newEvent = new EventStruct( "", "New equipment has increased the ships strength", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 2, 0, 0, 0) } ); break; case 75: newEvent = new EventStruct( "", "You have received a transfer of units", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 100, 0) } ); break; case 76: newEvent = new EventStruct( "", "Unfortunately there was a glitch in your ships system and you have lost some units", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, -100, 0) } ); break; case 77: newEvent = new EventStruct( "", "Unfortunately whilst travelling the ships has suffered a failure to the jump drive", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, 0, 0, 0, -2) } ); break; case 78: newEvent = new EventStruct( "", "A debilitating illness has ravaged your crew putting crital systems at risk", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -5, -80, -50, -2) } ); break; case 79: newEvent = new EventStruct( "", "Members of the science team have realised their experiment was corrupted", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -1, -100, -10, 0) } ); break; case 80: newEvent = new EventStruct( "", "Experiments by the science team didn't go great with a section of the ship missing", new string[] { "End" }, new EventConsequences[] { new EventConsequences(0, false, new int[] {}, -5, -100, -100, -1) } ); break; default: break; } return(newEvent); }
private static extern int Unmanaged_GetEvent(ref EventStruct eventDataSample);
public int iV_GetEvent(ref EventStruct eventDataSample) { return Unmanaged_GetEvent(ref eventDataSample); }
public static Tae ReadTae(string path) { Tae tae = new Tae(); BinaryReader file = new BinaryReader(File.Open(path, FileMode.Open)); tae.header = new Header(); tae.data = new Data(); tae.header.signature = file.ReadBytes(4); if (Encoding.ASCII.GetString(tae.header.signature) == "TAE ") { tae.header.unk1 = file.ReadUInt32(); tae.header.unk2 = file.ReadUInt32(); tae.header.fileSize = file.ReadUInt32(); tae.header.unk3 = file.ReadBytes(64); tae.header.id = file.ReadUInt32(); tae.header.idCount = file.ReadUInt32(); tae.header.idsOffset = file.ReadUInt32(); tae.header.groupsOffset = file.ReadUInt32(); tae.header.unk4 = file.ReadUInt32(); tae.header.dataCount = file.ReadUInt32(); tae.header.dataOffset = file.ReadUInt32(); tae.header.unk5 = file.ReadBytes(40); tae.header.filenamesOffset = file.ReadUInt32(); tae.data.skeletonHkxName = new NameStruct(); tae.data.SibName = new NameStruct(); file.BaseStream.Seek(tae.header.filenamesOffset, SeekOrigin.Begin); tae.data.skeletonHkxName.offset = file.ReadUInt32(); tae.data.SibName.offset = file.ReadUInt32(); tae.data.unk = file.ReadUInt64(); file.BaseStream.Seek(tae.data.skeletonHkxName.offset, SeekOrigin.Begin); tae.data.skeletonHkxName.name = MyReadChars(file); file.BaseStream.Seek(tae.data.SibName.offset, SeekOrigin.Begin); tae.data.SibName.name = MyReadChars(file); file.BaseStream.Seek(tae.header.idsOffset, SeekOrigin.Begin); tae.data.ids = new List <IdStruct> { }; for (int i = 0; i < tae.header.idCount; i++) { IdStruct id = new IdStruct(); id.id = file.ReadUInt32(); id.offset = file.ReadUInt32(); tae.data.ids.Add(id); } file.BaseStream.Seek(tae.header.groupsOffset, SeekOrigin.Begin); tae.data.groupCount = file.ReadUInt32(); tae.data.groupDataOffset = file.ReadUInt32(); file.BaseStream.Seek(tae.data.groupDataOffset, SeekOrigin.Begin); tae.data.groups = new List <GroupStruct> { }; for (int i = 0; i < tae.data.groupCount; i++) { GroupStruct group = new GroupStruct(); group.firstId = file.ReadUInt32(); group.lastId = file.ReadUInt32(); group.firstIdOffset = file.ReadUInt32(); tae.data.groups.Add(group); } file.BaseStream.Seek(tae.header.dataOffset, SeekOrigin.Begin); tae.data.animDatas = new List <AnimDataStruct> { }; long currpos = 0; for (int i = 0; i < tae.header.dataCount; i++) { AnimDataStruct animData = new AnimDataStruct(); animData.eventCount = file.ReadUInt32(); animData.eventHeaderOffset = file.ReadUInt32(); animData.unk = file.ReadUInt64(); animData.timeConstantsCount = file.ReadUInt32(); animData.timeConstantsOffset = file.ReadUInt32(); animData.animFileOffset = file.ReadUInt32(); currpos = file.BaseStream.Position; file.BaseStream.Seek(animData.animFileOffset, SeekOrigin.Begin); animData.animFile = new AnimFileStruct(); animData.animFile.name = new NameStruct(); animData.animFile.type = file.ReadUInt32(); animData.animFile.dataOffset = file.ReadUInt32(); if (animData.animFile.type == 0) { animData.animFile.name.offset = file.ReadUInt32(); } else { animData.animFile.nextFileOffset = file.ReadUInt32(); animData.animFile.linkedAnimId = file.ReadUInt32(); } animData.animFile.unk1 = file.ReadUInt32(); animData.animFile.unk2 = file.ReadUInt32(); animData.animFile.nulla = file.ReadUInt32(); if (animData.animFile.type == 0) { file.BaseStream.Seek(animData.animFile.name.offset, SeekOrigin.Begin); animData.animFile.name.name = MyReadChars(file); } animData.events = new List <EventStruct> { }; for (int j = 0; j < animData.eventCount; j++) { EventStruct Event = new EventStruct(); file.BaseStream.Seek(animData.eventHeaderOffset + j * 12, SeekOrigin.Begin); Event.startTimeOffset = file.ReadUInt32(); Event.endTimeOffset = file.ReadUInt32(); Event.eventbodyOffset = file.ReadUInt32(); file.BaseStream.Seek(Event.startTimeOffset, SeekOrigin.Begin); Event.startTime = file.ReadSingle(); Event.startTimeOffset -= animData.timeConstantsOffset; file.BaseStream.Seek(Event.endTimeOffset, SeekOrigin.Begin); Event.endTime = file.ReadSingle(); Event.endTimeOffset -= animData.timeConstantsOffset; file.BaseStream.Seek(Event.eventbodyOffset, SeekOrigin.Begin); Event.eventType = file.ReadUInt32(); Event.eventParamOffset = file.ReadUInt32(); file.BaseStream.Seek(Event.eventParamOffset, SeekOrigin.Begin); Event.parameters = ReadParams(Event.eventType, file); if (Event.parameters[0] == null) { tae.err = "Unrecognized event type: " + BitConverter.ToInt32(Event.parameters[1], 0) + "\n\nPosition in the file: " + file.BaseStream.Position; file.Close(); return(tae); } animData.events.Add(Event); } file.BaseStream.Seek(animData.timeConstantsOffset, SeekOrigin.Begin); animData.timeConstants = new List <float> { }; for (int j = 0; j < animData.timeConstantsCount; j++) { animData.timeConstants.Add(file.ReadSingle()); } file.BaseStream.Seek((uint)currpos, SeekOrigin.Begin); tae.data.animDatas.Add(animData); } } else { tae.err = "Specified file is not a TAE file."; } file.Close(); return(tae); }
public const int MAX_BRT_SST_DIFF = 40; // max. age difference between brothers/sisters static GKData() { GreatPrefix = LSID.LSID_RK_GreatPrefix; // TODO: need to find a way of localization NumKinship = new string[] { "-", "юродный", "юродная", "" }; // TODO: need to find a way of localization Numerals = new string[] { "-", "дво", "тро", "четверо", "пяти", "шести", "семи", "восьми", "девяти" }; RelationSigns = new string[] { "?", "P", "S", "C", "F", "M", "H", "W", "Sn", "Dg", "Gf", "Gm", "Gs", "Gd", "Br", "St", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" }; RelationKinds = new LSID[] { LSID.LSID_RK_Unk, LSID.LSID_None, LSID.LSID_None, LSID.LSID_None, LSID.LSID_RK_Father, LSID.LSID_RK_Mother, LSID.LSID_RK_Husband, LSID.LSID_RK_Wife, LSID.LSID_RK_Son, LSID.LSID_RK_Daughter, LSID.LSID_RK_Grandfather, LSID.LSID_RK_Grandmother, LSID.LSID_RK_Grandson, LSID.LSID_RK_Granddaughter, LSID.LSID_RK_Brother, LSID.LSID_RK_Sister, LSID.LSID_RK_SonInLaw, LSID.LSID_RK_DaughterInLaw, LSID.LSID_RK_HusbandFather, LSID.LSID_RK_HusbandMother, LSID.LSID_RK_WifeFather, LSID.LSID_RK_WifeMother, LSID.LSID_RK_Uncle, LSID.LSID_RK_Aunt, LSID.LSID_RK_Nephew, LSID.LSID_RK_Niece, LSID.LSID_RK_CousinM, LSID.LSID_RK_CousinF, LSID.LSID_RK_BrotherInLaw_H, LSID.LSID_RK_SisterInLaw_H, LSID.LSID_RK_BrotherInLaw_W, LSID.LSID_RK_SisterInLaw_W, LSID.LSID_None, LSID.LSID_RK_Unk }; SpecialUserRefs = new SpecialUserRef[] { new SpecialUserRef(LSID.LSID_RI_GeorgeKnight, ""), new SpecialUserRef(LSID.LSID_USSR_WWII_Combatant, ""), new SpecialUserRef(LSID.LSID_USSR_WWII_KilledInBattle, ""), new SpecialUserRef(LSID.LSID_USSR_WWII_WorkerInRear, ""), new SpecialUserRef(LSID.LSID_USSR_Repressed, ""), new SpecialUserRef(LSID.LSID_Religion_Islam, ""), new SpecialUserRef(LSID.LSID_Religion_Catholicism, ""), new SpecialUserRef(LSID.LSID_Religion_Orthodoxy, ""), new SpecialUserRef(LSID.LSID_Religion_TheOldBelievers, "") }; CertaintyAssessments = new LSID[] { LSID.LSID_Cert_1, LSID.LSID_Cert_2, LSID.LSID_Cert_3, LSID.LSID_Cert_4 }; GoalNames = new LSID[] { LSID.LSID_G_1, LSID.LSID_G_2, LSID.LSID_G_3, LSID.LSID_G_4 }; CommunicationDirs = new LSID[] { LSID.LSID_CD_1, LSID.LSID_CD_2 }; CommunicationNames = new LSID[] { LSID.LSID_Com_1, LSID.LSID_Com_2, LSID.LSID_Com_3, LSID.LSID_Com_4, LSID.LSID_Com_5, LSID.LSID_Com_6 }; StatusNames = new LSID[] { LSID.LSID_RStat_1, LSID.LSID_RStat_2, LSID.LSID_RStat_3, LSID.LSID_RStat_4, LSID.LSID_RStat_5, LSID.LSID_RStat_6 }; PriorityNames = new LSID[] { LSID.LSID_Prt_1, LSID.LSID_Prt_2, LSID.LSID_Prt_3, LSID.LSID_Prt_4, LSID.LSID_Prt_5 }; MediaTypes = new LSID[] { LSID.LSID_DefaultValue, // TODO: may be LSID.LSID_MT_15 (Unknown)? LSID.LSID_MT_02, LSID.LSID_MT_03, LSID.LSID_MT_04, LSID.LSID_MT_05, LSID.LSID_MT_06, LSID.LSID_MT_07, LSID.LSID_MT_08, LSID.LSID_MT_09, LSID.LSID_MT_10, LSID.LSID_MT_11, LSID.LSID_MT_12, LSID.LSID_MT_13, LSID.LSID_MT_14 //LSID.LSID_MT_15 <Unknown removed to first position> }; GKStoreTypes = new StoreTypeRec[] { new StoreTypeRec(LSID.LSID_STRef, ""), new StoreTypeRec(LSID.LSID_STStg, "stg:"), new StoreTypeRec(LSID.LSID_STArc, "arc:"), new StoreTypeRec(LSID.LSID_STRel, "rel:") }; FamilyEvents = new EventStruct[] { new EventStruct(LSID.LSID_Event, GEDCOMTagName.EVEN, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_1, GEDCOMTagName.ENGA, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_2, GEDCOMTagName.MARR, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_3, GEDCOMTagName.MARB, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_4, GEDCOMTagName.MARC, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_5, GEDCOMTagName.MARL, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_6, GEDCOMTagName.MARS, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_7, GEDCOMTagName.ANUL, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_8, GEDCOMTagName.DIVF, PersonEventKind.ekEvent), new EventStruct(LSID.LSID_FEvt_9, GEDCOMTagName.DIV, PersonEventKind.ekEvent), }; // FIXME: use calendars for StrToGEDCOMDate() and class EventEditDlg DateCalendars = new CalendarStruct[] { new CalendarStruct(LSID.LSID_Cal_Gregorian, " [G]", true), new CalendarStruct(LSID.LSID_Cal_Julian, " [J]", true), new CalendarStruct(LSID.LSID_Cal_Hebrew, " [H]", false), // ! new CalendarStruct(LSID.LSID_Cal_French, " [FR]", false), new CalendarStruct(LSID.LSID_Cal_Roman, " [R]", false), new CalendarStruct(LSID.LSID_Cal_Islamic, " [I]", false), // ! new CalendarStruct(LSID.LSID_Unknown, "", false) }; DateKindStruct[] array5 = new DateKindStruct[10]; array5[0] = new DateKindStruct(LSID.LSID_DK_0, 1); // 1 array5[1] = new DateKindStruct(LSID.LSID_DK_1, 2); // 2 array5[2] = new DateKindStruct(LSID.LSID_DK_2, 1); // 1 array5[3] = new DateKindStruct(LSID.LSID_DK_3, 3); // 1,2 array5[4] = new DateKindStruct(LSID.LSID_DK_4, 1); // 1 array5[5] = new DateKindStruct(LSID.LSID_DK_5, 2); // 2 array5[6] = new DateKindStruct(LSID.LSID_DK_6, 3); // 1,2 array5[7] = new DateKindStruct(LSID.LSID_DK_7, 1); // 1 array5[8] = new DateKindStruct(LSID.LSID_DK_8, 1); // 1 array5[9] = new DateKindStruct(LSID.LSID_DK_9, 1); // 1 DateKinds = array5; EventStruct[] array6 = new EventStruct[41]; array6[0] = new EventStruct(LSID.LSID_Event, GEDCOMTagName.EVEN, PersonEventKind.ekEvent); array6[1] = new EventStruct(LSID.LSID_Birth, GEDCOMTagName.BIRT, PersonEventKind.ekEvent); array6[2] = new EventStruct(LSID.LSID_Adoption, GEDCOMTagName.ADOP, PersonEventKind.ekEvent); array6[3] = new EventStruct(LSID.LSID_Christening, GEDCOMTagName.CHR, PersonEventKind.ekEvent); array6[4] = new EventStruct(LSID.LSID_Graduation, GEDCOMTagName.GRAD, PersonEventKind.ekEvent); array6[5] = new EventStruct(LSID.LSID_Retirement, GEDCOMTagName.RETI, PersonEventKind.ekEvent); array6[6] = new EventStruct(LSID.LSID_Naturalization, GEDCOMTagName.NATU, PersonEventKind.ekEvent); array6[7] = new EventStruct(LSID.LSID_Emigration, GEDCOMTagName.EMIG, PersonEventKind.ekEvent); array6[8] = new EventStruct(LSID.LSID_Immigration, GEDCOMTagName.IMMI, PersonEventKind.ekEvent); array6[9] = new EventStruct(LSID.LSID_Census, GEDCOMTagName.CENS, PersonEventKind.ekEvent); array6[10] = new EventStruct(LSID.LSID_LastWill, GEDCOMTagName.WILL, PersonEventKind.ekEvent); array6[11] = new EventStruct(LSID.LSID_ProbateOfWill, GEDCOMTagName.PROB, PersonEventKind.ekEvent); array6[12] = new EventStruct(LSID.LSID_Death, GEDCOMTagName.DEAT, PersonEventKind.ekEvent); array6[13] = new EventStruct(LSID.LSID_Burial, GEDCOMTagName.BURI, PersonEventKind.ekEvent); array6[14] = new EventStruct(LSID.LSID_Cremation, GEDCOMTagName.CREM, PersonEventKind.ekEvent); array6[15] = new EventStruct(LSID.LSID_Fact, GEDCOMTagName.FACT, PersonEventKind.ekFact); array6[16] = new EventStruct(LSID.LSID_Religion, GEDCOMTagName.RELI, PersonEventKind.ekFact); array6[17] = new EventStruct(LSID.LSID_Nationality, GEDCOMTagName.NATI, PersonEventKind.ekFact); array6[18] = new EventStruct(LSID.LSID_Residence, GEDCOMTagName.RESI, PersonEventKind.ekFact); array6[19] = new EventStruct(LSID.LSID_PhysicalDesc, GEDCOMTagName.DSCR, PersonEventKind.ekFact); array6[20] = new EventStruct(LSID.LSID_NationalIDNumber, GEDCOMTagName.IDNO, PersonEventKind.ekFact); array6[21] = new EventStruct(LSID.LSID_SocialSecurityNumber, GEDCOMTagName.SSN, PersonEventKind.ekFact); array6[22] = new EventStruct(LSID.LSID_ChildsCount, GEDCOMTagName.NCHI, PersonEventKind.ekFact); array6[23] = new EventStruct(LSID.LSID_MarriagesCount, GEDCOMTagName.NMR, PersonEventKind.ekFact); array6[24] = new EventStruct(LSID.LSID_Education, GEDCOMTagName.EDUC, PersonEventKind.ekFact); array6[25] = new EventStruct(LSID.LSID_Occupation, GEDCOMTagName.OCCU, PersonEventKind.ekFact); array6[26] = new EventStruct(LSID.LSID_Caste, GEDCOMTagName.CAST, PersonEventKind.ekFact); array6[27] = new EventStruct(LSID.LSID_Property, GEDCOMTagName.PROP, PersonEventKind.ekFact); array6[28] = new EventStruct(LSID.LSID_NobilityTitle, GEDCOMTagName.TITL, PersonEventKind.ekFact); array6[29] = new EventStruct(LSID.LSID_Travel, GEDCOMTagName._TRAVEL, PersonEventKind.ekFact); array6[30] = new EventStruct(LSID.LSID_Hobby, GEDCOMTagName._HOBBY, PersonEventKind.ekFact); array6[31] = new EventStruct(LSID.LSID_Award, GEDCOMTagName._AWARD, PersonEventKind.ekFact); array6[32] = new EventStruct(LSID.LSID_Mili, GEDCOMTagName._MILI, PersonEventKind.ekFact); array6[33] = new EventStruct(LSID.LSID_MiliInd, GEDCOMTagName._MILI_IND, PersonEventKind.ekFact); array6[34] = new EventStruct(LSID.LSID_MiliDis, GEDCOMTagName._MILI_DIS, PersonEventKind.ekFact); array6[35] = new EventStruct(LSID.LSID_MiliRank, GEDCOMTagName._MILI_RANK, PersonEventKind.ekFact); array6[36] = new EventStruct(LSID.LSID_BloodGroup, GEDCOMTagName._BGRO, PersonEventKind.ekFact); array6[37] = new EventStruct(LSID.LSID_HairColor, GEDCOMTagName._HAIR, PersonEventKind.ekFact); array6[38] = new EventStruct(LSID.LSID_EyesColor, GEDCOMTagName._EYES, PersonEventKind.ekFact); array6[39] = new EventStruct(LSID.LSID_MDNAHaplogroup, GEDCOMTagName._MDNA, PersonEventKind.ekFact); array6[40] = new EventStruct(LSID.LSID_YDNAHaplogroup, GEDCOMTagName._YDNA, PersonEventKind.ekFact); PersonEvents = array6; MarriageStatus = new MarStatusStruct[] { new MarStatusStruct(LSID.LSID_Unknown, ""), new MarStatusStruct(LSID.LSID_MarrRegistered, "MARRIED"), new MarStatusStruct(LSID.LSID_MarrNotRegistered, "MARRNOTREG"), new MarStatusStruct(LSID.LSID_MarrDivorced, "NOTMARR") }; SexData = new SexStruct[] { new SexStruct(LSID.LSID_SexU, "U"), new SexStruct(LSID.LSID_SexM, "M"), new SexStruct(LSID.LSID_SexF, "F"), new SexStruct(LSID.LSID_SexX, "X") }; RecordTypes = new LSID[] { LSID.LSID_None, LSID.LSID_Person, LSID.LSID_Family, LSID.LSID_Note, LSID.LSID_RPMultimedia, LSID.LSID_Source, LSID.LSID_Repository, LSID.LSID_Group, LSID.LSID_Research, LSID.LSID_Task, LSID.LSID_Communication, LSID.LSID_Location, LSID.LSID_Submission, LSID.LSID_Submitter }; Restrictions = new LSID[] { LSID.LSID_RestrictNone, LSID.LSID_RestrictLocked, LSID.LSID_RestrictConfidential, LSID.LSID_RestrictPrivacy }; StatsTitles = new StatsTitleStruct[37]; StatsTitles[0] = new StatsTitleStruct(LSID.LSID_AncestorsCount, LSID.LSID_Name); StatsTitles[1] = new StatsTitleStruct(LSID.LSID_DescendantsCount, LSID.LSID_Name); StatsTitles[2] = new StatsTitleStruct(LSID.LSID_GenerationsCount, LSID.LSID_Name); StatsTitles[3] = new StatsTitleStruct(LSID.LSID_Surname, LSID.LSID_Surname); StatsTitles[4] = new StatsTitleStruct(LSID.LSID_Name, LSID.LSID_Name); StatsTitles[5] = new StatsTitleStruct(LSID.LSID_Patronymic, LSID.LSID_Patronymic); StatsTitles[6] = new StatsTitleStruct(LSID.LSID_Age, LSID.LSID_Age); StatsTitles[7] = new StatsTitleStruct(LSID.LSID_LifeExpectancy, LSID.LSID_Age); StatsTitles[8] = new StatsTitleStruct(LSID.LSID_BirthYears, LSID.LSID_BirthYears); StatsTitles[9] = new StatsTitleStruct(LSID.LSID_BirthYearsDec, LSID.LSID_BirthYears); StatsTitles[10] = new StatsTitleStruct(LSID.LSID_DeathYears, LSID.LSID_DeathYears); StatsTitles[11] = new StatsTitleStruct(LSID.LSID_DeathYearsDec, LSID.LSID_DeathYears); StatsTitles[12] = new StatsTitleStruct(LSID.LSID_ChildsCount, LSID.LSID_Name); StatsTitles[13] = new StatsTitleStruct(LSID.LSID_DistrChilds, LSID.LSID_ChildsCount); StatsTitles[14] = new StatsTitleStruct(LSID.LSID_BirthPlace, LSID.LSID_BirthPlace); StatsTitles[15] = new StatsTitleStruct(LSID.LSID_DeathPlace, LSID.LSID_DeathPlace); StatsTitles[16] = new StatsTitleStruct(LSID.LSID_Residence, LSID.LSID_Residence); StatsTitles[17] = new StatsTitleStruct(LSID.LSID_Occupation, LSID.LSID_Occupation); StatsTitles[18] = new StatsTitleStruct(LSID.LSID_Religion, LSID.LSID_Religion); StatsTitles[19] = new StatsTitleStruct(LSID.LSID_Nationality, LSID.LSID_Nationality); StatsTitles[20] = new StatsTitleStruct(LSID.LSID_Education, LSID.LSID_Education); StatsTitles[21] = new StatsTitleStruct(LSID.LSID_Caste, LSID.LSID_Caste); StatsTitles[22] = new StatsTitleStruct(LSID.LSID_AgeFirstborn, LSID.LSID_Name); StatsTitles[23] = new StatsTitleStruct(LSID.LSID_MarriagesCount, LSID.LSID_Name); StatsTitles[24] = new StatsTitleStruct(LSID.LSID_MarriagesAge, LSID.LSID_Name); StatsTitles[25] = new StatsTitleStruct(LSID.LSID_DiffSpouses, LSID.LSID_Family); StatsTitles[26] = new StatsTitleStruct(LSID.LSID_Hobby, LSID.LSID_Hobby); StatsTitles[27] = new StatsTitleStruct(LSID.LSID_Award, LSID.LSID_Award); StatsTitles[28] = new StatsTitleStruct(LSID.LSID_Mili, LSID.LSID_Mili); StatsTitles[29] = new StatsTitleStruct(LSID.LSID_MiliInd, LSID.LSID_MiliInd); StatsTitles[30] = new StatsTitleStruct(LSID.LSID_MiliDis, LSID.LSID_MiliDis); StatsTitles[31] = new StatsTitleStruct(LSID.LSID_MiliRank, LSID.LSID_MiliRank); StatsTitles[32] = new StatsTitleStruct(LSID.LSID_AAF_1, LSID.LSID_AAF_1); StatsTitles[33] = new StatsTitleStruct(LSID.LSID_AAF_2, LSID.LSID_AAF_2); StatsTitles[34] = new StatsTitleStruct(LSID.LSID_CertaintyIndex, LSID.LSID_CertaintyIndex); StatsTitles[35] = new StatsTitleStruct(LSID.LSID_BirthByMonth, LSID.LSID_BirthByMonth); StatsTitles[36] = new StatsTitleStruct(LSID.LSID_Demography, LSID.LSID_Demography); CheckSolveNames = new LSID[] { LSID.LSID_RM_Skip, LSID.LSID_SetIsDead, LSID.LSID_DefineSex, LSID.LSID_DoDelete, LSID.LSID_DoEdit }; CondSigns = new string[] { "!=", "<", "<=", "==", "=>", ">", "contains", "not contains" }; NameTypes = new LSID[] { LSID.LSID_DefaultValue, LSID.LSID_NTAka, LSID.LSID_NTBirth, LSID.LSID_NTImmigrant, LSID.LSID_NTMaiden, LSID.LSID_NTMarried }; ParentTypes = new LSID[] { LSID.LSID_DefaultValue, LSID.LSID_PLT_Adopted, LSID.LSID_PLT_Birth, LSID.LSID_PLT_Foster, }; BloodGroups = "|(I) O+|(I) O-|(II) A+|(II) A-|(III) B+|(III) B-|(IV) AB+|(IV) AB-"; }
public static int CompareEventStructsByDate(EventStruct a, EventStruct b) { if (a.EventDate == null) { if (b.EventDate == null) // Both null return 0; else // B is greater return -1; } else { if (b.EventDate == null) // A is greater return 1; else return a.EventDate.CompareTo(b.EventDate); } }