Exemplo n.º 1
0
		public void fillGameData()
		{

			TextAsset flist=Resources.Load("flist") as TextAsset;
			Conditional read=new Conditional();
			bool result=true;
			int pos=0;
			string file=read.readString(flist.text,ref pos, out result);
			StringBuilder sb=new StringBuilder();
			while(result)
			{
				TextAsset ass=Resources.Load(file) as TextAsset;
				if(ass!=null)
				{
					sb.Append(ass.text);
				}
				file=read.readString(flist.text,ref pos, out result);
			}
			_GameData=Conditional.loadFromString(sb.ToString()); //a test, for now..
      /*IList testop=_GameData["testFunc"] as IList;
      Conditional tstack=new Conditional();
      tstack[_target]=tstack;
      Debug.Log("testop");
      foreach(object o in testop)
      {
        Operation op=o as Operation;
        op._execute(tstack);
      }
      Debug.Log(tstack["Damage"]);
      Debug.Log("endtestop");*/
			List<Conditional> deck=new List<Conditional>();
			for(int i=0; i<30; i++)
				deck.Add(generateRandomCardTemplate());
			//_GameData["DECK"]=deck;
			//_GameData["HAND"]=new List<Conditional>();
			//List<Conditional> effs=new List<Conditional>();
		//	Conditional drawRule=_GameData["drawRule"] as Conditional;
			//Debug.Log(drawRule);
			//Debug.Log(drawRule[_commands]);
			//Debug.Log(drawRule[_condition]);
			// new Conditional();
			
			//effs.Add(drawRule);
			//_GameData[_effects]=effs;
		}