package com.terry.engine {
	import flash.display.*;
	import flash.geom.*;
  import flash.events.*;
  import flash.net.*;
	import flash.utils.Dictionary;
	
	public class flag {
		public static function init():void {
			for (var i:int = 0; i < 300; i++) flags.push(0);
		}
		
		public static function resetflags():void {
			for (var i:int = 0; i < 300; i++) {
				flags[i] = 0;
			}
		}
		
		public static function istrue(t:String):Boolean {
			if (flagindex[t] == undefined) {
				return false;
			}else{
				if (flags[flagindex[t]] == 1) return true;
			}
			return false;
		}
		
		public static function isfalse(t:String):Boolean {
			return !istrue(t);
		}
		
		public static function settrue(t:String):void {
			if (flagindex[t] == undefined) {
				flagindex[t] = numflag;
				numflag++;
				flags[flagindex[t]] = 1;
			}else {
				flags[flagindex[t]] = 1;
			}
		}
		
		public static function setfalse(t:String):void {
			if (flagindex[t] == undefined) {
				flagindex[t] = numflag;
				numflag++;
				flags[flagindex[t]] = 0;
			}else {
				flags[flagindex[t]] = 0;
			}
		}
		
		public static var flags:Vector.<int> = new Vector.<int>;
		public static var flagindex:Dictionary = new Dictionary; //Holds the indexes!
		public static var numflag:int = 0;
	}
}
