Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package otherlib.eventsystem{
- import otherlib.roomcontroller.roomJobChange;
- import otherlib.data.GameData;
- import otherlib.roomcontroller.job;
- public class jobStart {
- public static var jobArray:Array = [];
- //okay first off we need to fill the array before doing anything
- public static function makeJobArray() {
- cleanJob();//get rid of it
- var time:int = new int();
- time = GameData.charTime;
- //first we need to find out where the girls are and what room they are in
- var room:int = new int(0);
- for(var i:int = 0; i < GameData.GameArray.length; i++) {
- var jc:jobClass = new jobClass();
- jc.jobGirl = i; // okay we know that the girl exists!
- if(time == 1) {
- room = GameData.GameArray[i].girlMorning;
- }
- if(time == 2) {
- room = GameData.GameArray[i].girlAfternoon;
- }
- if(time == 3) {
- room = GameData.GameArray[i].girlEvening;
- }
- else {
- room = GameData.GameArray[i].girlNight;
- }
- var jobType:String = new String();
- trace("room: " + room + " time: " + time);
- jc.jobType = roomJobChange.getJobValue(room + 1, time);
- //now we need to find the actual item for the job
- jc.jobEvent = findJobToEvent(jc.jobType);
- //wait what if she is in the pens?!?! bah just throw it away...
- if(room != -1) {
- //okay we know the girl, the room and time and job
- jobArray.push(jc);
- }
- }
- /*trace(jobArray);
- trace("Type: " + jobArray[0].jobType);
- trace("Event: " + jobArray[0].jobEvent);
- trace("Girl: " + jobArray[0].jobGirl);*/
- startJob();
- }
- public static function startJob() {
- if(jobArray.length != 0) {
- eveSys.eveRun(jobArray[0].jobEvent);
- }
- }
- public static function findJobToEvent(lab:String):String {
- for(var i:int = 0; i < job.jobInfo.length; i++) {
- if(job.jobInfo[i].jName == lab) {
- return job.jobInfo[i].jEvent;
- }
- }
- return "restjob";
- }
- public static function cleanJob() {
- while(jobArray.length != 0) {
- jobArray.splice(0,1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement