/// <summary> /// Creates an NPC Schedule object /// This is easier to consume than the structure /// </summary> /// <param name="sched"></param> public NonPlayerCharacterSchedule(NPC_Schedule sched) { Coords = new List <Point3D>(); Times = new List <byte>(); unsafe { for (int i = 0; i < 3; i++) { AIType.Add(sched.AI_types[i]); Coords.Add(new Point3D(sched.x_coordinates[i], sched.y_coordinates[i], sched.z_coordinates[i])); if (sched.z_coordinates[i] != 0) { System.Console.Write(""); } } // argh, I can't get the size dynamically of the arrays for (int i = 0; i < 4; i++) { Times.Add(sched.times[i]); } } }
/// <summary> /// Construct an NPC /// </summary> /// <param name="mapRef">Which map are they on?</param> /// <param name="sched">daily schedule</param> /// <param name="npcType">type of NPC they are</param> /// <param name="dialogNumber">dialog number referencing data OVL</param> /// <param name="dialogIndex">0-31 index of it's position in the NPC arrays (used for saved.gam references)</param> /// <param name="talkScript">their conversation script</param> public NonPlayerCharacterReference(SmallMapReferences.SingleMapReference.Location location, GameState gameStateRef, NPC_Schedule sched, byte npcType, byte dialogNumber, int dialogIndex, TalkScript talkScript, int nKeySprite) { Schedule = new NonPlayerCharacterSchedule(sched); MapLocation = location; NPCKeySprite = nKeySprite; CharacterType = npcType; DialogNumber = dialogNumber; Script = talkScript; DialogIndex = dialogIndex; this.gameStateRef = gameStateRef; // no schedule? I guess you're not real if (!IsEmptySched(sched)) { System.Console.WriteLine(location.ToString() + " NPC Number: " + this.DialogNumber + " in " + location.ToString()); } }