public void ConcreteFun() { // 2 0 1 //y = First(a, isNan) var graph = new GraphBuilder(); graph.SetVar("a", 0); graph.SetVarType("isNan", StateFun.Of(StatePrimitive.Real, StatePrimitive.Bool)); graph.SetVar("isNan", 1); graph.SetGetFirst(0, 1, 2); graph.SetDef("y", 2); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.Real), "a"); }
public void ImpossibleArgType_Throws() { // 1 0 //x:Any[]; y = NoNans(x) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StatePrimitive.Any)); graph.SetVar("x", 0); TestHelper.AssertThrowsTicError(() => { graph.SetCall(new ITicNodeState[] { StateArray.Of(StatePrimitive.Real), StatePrimitive.Bool }, new[] { 0, 1 }); graph.SetDef("y", 1); graph.Solve(); Assert.Fail(); }); }
public void Concat_RightConcreteArg() { // 2 0 1 //b:int[]; y = concat(a,b) var graph = new GraphBuilder(); graph.SetVarType("b", StateArray.Of(StatePrimitive.I32)); graph.SetVar("a", 0); graph.SetVar("b", 1); graph.SetConcatCall(0, 1, 2); graph.SetDef("y", 2); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamedEqualToArrayOf(StatePrimitive.I32, "y", "a", "b"); }
public void ConcreteCall() { // 1 0 //y = NoNans(x) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetCall(new ITicNodeState[] { StateArray.Of(StatePrimitive.Real), StatePrimitive.Bool }, new [] { 0, 1 }); graph.SetDef("y", 1); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.Real), "x"); result.AssertNamed(StatePrimitive.Bool, "y"); }
public void Count() { // 1 0 //y = count('abc') var graph = new GraphBuilder(); graph.SetArrayConst(0, StatePrimitive.Char); graph.SetCall(new ITicNodeState[] { StateArray.Of(StatePrimitive.Any), StatePrimitive.I32 }, new [] { 0, 1 }); graph.SetDef("y", 1); var res = graph.Solve(); res.AssertNoGenerics(); res.AssertNamed(StatePrimitive.I32, "y"); }
public void ArrayInitWithSpecifiedArrayTypeAndDowncast_fails() { // 3 0 1 2 // y:byte[] = [1i,2i,3i] var graph = new GraphBuilder(); graph.SetVarType("y", StateArray.Of(StatePrimitive.U8)); graph.SetConst(0, StatePrimitive.I32); graph.SetConst(1, StatePrimitive.I32); graph.SetConst(2, StatePrimitive.I32); graph.SetStrictArrayInit(3, 0, 1, 2); TestHelper.AssertThrowsTicError(() => { graph.SetDef("y", 3); graph.Solve(); }); }
public void OneDimention_ImpossibleConcreteArgAndDef() { // 2 0,1 //x:int[]; y:i16 = get(x,0) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StatePrimitive.I32)); graph.SetVar("x", 0); graph.SetConst(1, StatePrimitive.I32); graph.SetArrGetCall(0, 1, 2); TestHelper.AssertThrowsTicError(() => { graph.SetVarType("y", StatePrimitive.I16); graph.SetDef("y", 2); graph.Solve(); }); }
public void TwoDimention_InitConcrete() { // 4 3 0 1 2 // y = [[1i,2i,3i]] var graph = new GraphBuilder(); graph.SetConst(0, StatePrimitive.I32); graph.SetConst(1, StatePrimitive.I32); graph.SetConst(2, StatePrimitive.I32); graph.SetStrictArrayInit(3, 0, 1, 2); graph.SetStrictArrayInit(4, 3); graph.SetDef("y", 4); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StateArray.Of(StatePrimitive.I32)), "y"); }
public void Array_referencesItselfManyTimes() { // 4 0 3 1 2 //x = concat(x,concat(x,x) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetVar("x", 1); graph.SetVar("x", 2); graph.SetConcatCall(1, 2, 3); graph.SetConcatCall(0, 3, 4); graph.SetDef("x", 4); var result = graph.Solve(); var res = result.AssertAndGetSingleGeneric(null, null); result.AssertNamed(StateArray.Of(res), "x"); }
public void ConcreteFun() { // 2 0 1 //y = Map(a, SQRT) var graph = new GraphBuilder(); graph.SetVar("a", 0); graph.SetVarType("SQRT", StateFun.Of(StatePrimitive.Real, StatePrimitive.Real)); graph.SetVar("SQRT", 1); graph.SetMap(0, 1, 2); graph.SetDef("y", 2); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.Real), "a", "y"); }
public void ToByteArray1() { StateArray stateArray = new StateArray(64); BitArray referenceBitArray = new BitArray(64, false); stateArray[0] = referenceBitArray[0] = true; stateArray[1] = referenceBitArray[1] = true; stateArray[8] = referenceBitArray[8] = true; stateArray[32] = referenceBitArray[32] = true; stateArray[33] = referenceBitArray[33] = true; stateArray[62] = referenceBitArray[62] = true; stateArray[63] = referenceBitArray[63] = true; byte[] expectedBytes = new byte[64 / 8]; referenceBitArray.CopyTo(expectedBytes, 0); byte[] actualBytes = stateArray.ToByteArray(); Assert.IsTrue(actualBytes.SequenceEqual(expectedBytes)); }
public void ArrayInitWithSpecifiedArrayType() { // 3 0 1 2 // y:int[] = [1i,2i,3i] var graph = new GraphBuilder(); graph.SetVarType("y", StateArray.Of(StatePrimitive.I32)); graph.SetConst(0, StatePrimitive.I32); graph.SetConst(1, StatePrimitive.I32); graph.SetConst(2, StatePrimitive.I32); graph.SetStrictArrayInit(3, 0, 1, 2); graph.SetDef("y", 3); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamedEqualToArrayOf(StatePrimitive.I32, "y"); }
public StateArray getStates() { StateArray result = new StateArray(); try { gov.va.medora.mdo.dao.sql.zipcodeDB.ZipcodeDao dao = new gov.va.medora.mdo.dao.sql.zipcodeDB.ZipcodeDao(mySession.MdwsConfiguration.SqlConnectionString); State[] states = dao.getStates(); result = new StateArray(states); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return(result); }
public void ConcreteArg() { // 2 0,1 //x:int[]; y = get(x,0) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StatePrimitive.I32)); graph.SetVar("x", 0); graph.SetConst(1, StatePrimitive.I32); graph.SetArrGetCall(0, 1, 2); graph.SetDef("y", 2); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamedEqualToArrayOf(StatePrimitive.I32, "x"); result.AssertNamed(StatePrimitive.I32, "y"); }
public void ConcreteArgAndDef_Upcast() { // 2 0 //x:int[]; y:real = sum(x) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StatePrimitive.I32)); graph.SetVar("x", 0); graph.SetSumCall(0, 1); graph.SetVarType("y", StatePrimitive.Real); graph.SetDef("y", 1); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamedEqualToArrayOf(StatePrimitive.I32, "x"); result.AssertNamed(StatePrimitive.Real, "y"); }
public void Array_referencesItselfWithMap_RetTypeIsConcrete() { // 0 5 4 132 //x = x.map(f(a):i64=a+1) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetVar("la", 1); graph.SetIntConst(2, StatePrimitive.U8); graph.SetArith(1, 2, 3); graph.CreateLambda(3, 4, StatePrimitive.I64, "la"); graph.SetMap(0, 4, 5); graph.SetDef("x", 5); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.I64), "x"); }
public void Array_referencesItselfWithMap() { // 0 5 4 132 //x = x.map(f(a)=a+1) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetVar("la", 1); graph.SetIntConst(2, StatePrimitive.U8); graph.SetArith(1, 2, 3); graph.CreateLambda(3, 4, "la"); graph.SetMap(0, 4, 5); graph.SetDef("x", 5); var result = graph.Solve(); var res = result.AssertAndGetSingleArithGeneric(); result.AssertNamed(StateArray.Of(res), "x"); }
public void SetArrayConst() { // 1 0 //y = reverse( 'hello') var graph = new GraphBuilder(); graph.SetArrayConst(0, StatePrimitive.Char); var t = graph.InitializeVarNode(); graph.SetCall(new [] { StateArray.Of(t), StateArray.Of(t) }, new [] { 0, 1 }); graph.SetDef("y", 1); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNode(StateArray.Of(StatePrimitive.Char), 0); result.AssertNamed(StateArray.Of(StatePrimitive.Char), "y"); }
public void ArrayCycle_Solved() { // 4 2 0 1 3 //x = [ get(x,0) , 1] var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetIntConst(1, StatePrimitive.U8); graph.SetArrGetCall(0, 1, 2); graph.SetIntConst(3, StatePrimitive.U8); graph.SetStrictArrayInit(4, 2, 3); graph.SetDef("x", 4); var res = graph.Solve(); var t = res.AssertAndGetSingleGeneric(StatePrimitive.U8, StatePrimitive.Real); res.AssertNamed(StateArray.Of(t), "x"); }
public void Anything_WithBoolArray() { // 3 0 2 1 //y = Any(a, x->x) var graph = new GraphBuilder(); graph.SetVar("a", 0); graph.SetVar("2lx", 1); graph.CreateLambda(1, 2, "2lx"); graph.SetIsAny(0, 2, 3); graph.SetDef("y", 3); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.Bool), "a"); result.AssertNamed(StatePrimitive.Bool, "2lx"); result.AssertNode(StateFun.Of(StatePrimitive.Bool, StatePrimitive.Bool), 2); }
public void TwoDimentions_Generic() { // 4 2 0,1 3 //y = get(get(x,0),0) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetConst(1, StatePrimitive.I32); graph.SetArrGetCall(0, 1, 2); graph.SetConst(3, StatePrimitive.I32); graph.SetArrGetCall(2, 3, 4); graph.SetDef("y", 4); var result = graph.Solve(); var generic = result.AssertAndGetSingleGeneric(null, null); result.AssertNamed(StateArray.Of(new StateArray(generic)), "x"); result.AssertAreGenerics(generic, "y"); }
// Use this for initialization void Start() { relativePath = Application.dataPath; Application.runInBackground = true; Application.targetFrameRate = 60; //instantiate prey prey = Instantiate(preyprefab) as GameObject; Controller preyController = prey.GetComponent <Controller>(); preyStateArray = new StateArray(); preyController.stateArray = preyStateArray; preyQlearning = new QLearning(preyController, preyStateArray, prey.GetComponent <PreyScript>().actionSize); preyQlearning.bestaction = true; preyController.qAlgorithm = preyQlearning; //instantiate eadible eadible = Instantiate(eadibleprefab) as GameObject; } // end of start
public void ThreeDimentions_ConcreteDefArrayOf() { // 4 2 0,1 3 //y:real[] = get(get(x,0),0) var graph = new GraphBuilder(); graph.SetVar("x", 0); graph.SetConst(1, StatePrimitive.I32); graph.SetArrGetCall(0, 1, 2); graph.SetConst(3, StatePrimitive.I32); graph.SetArrGetCall(2, 3, 4); graph.SetVarType("y", StateArray.Of(StatePrimitive.Real)); graph.SetDef("y", 4); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StateArray.Of(StateArray.Of(StatePrimitive.Real))), "x"); result.AssertNamed(StateArray.Of(StatePrimitive.Real), "y"); }
public void SetGet2() { for (int i = 0; i < 160; i++) { StateArray stateArray = new StateArray(160); stateArray[i] = true; for (int k = 0; k < 160; k++) { if (k == i) { Assert.IsTrue(stateArray[k]); } else { Assert.IsFalse(stateArray[k]); } } } }
public void Concat_ConcreteDefAndSameLeftArg() { // 2 0 1 //a:real[]; y:real[] = concat(a,b) var graph = new GraphBuilder(); graph.SetVarType("a", StateArray.Of(StatePrimitive.Real)); graph.SetVar("a", 0); graph.SetVar("b", 1); graph.SetConcatCall(0, 1, 2); graph.SetVarType("y", StateArray.Of(StatePrimitive.Real)); graph.SetDef("y", 2); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamedEqualToArrayOf(StatePrimitive.Real, "y", "a", "b"); }
public void Array_referencesItselfWithMap_DefTypeIsImpossible2_Throws() { // 0 5 4 132 //x:bool[] = x.map(f(a)=a+1) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StatePrimitive.Bool)); graph.SetVar("x", 0); graph.SetVar("la", 1); graph.SetIntConst(2, StatePrimitive.U8); graph.SetArith(1, 2, 3); graph.CreateLambda(3, 4, "la"); TestHelper.AssertThrowsTicError(() => { graph.SetMap(0, 4, 5); graph.SetDef("x", 5); graph.Solve(); }); }
public void TwoDimentions_ConcreteArgAndDefWithUpcast() { // 4 2 0,1 3 //x:int[][]; y:real = get(get(x,0),0) var graph = new GraphBuilder(); graph.SetVarType("x", StateArray.Of(StateArray.Of(StatePrimitive.I32))); graph.SetVar("x", 0); graph.SetConst(1, StatePrimitive.I32); graph.SetArrGetCall(0, 1, 2); graph.SetConst(3, StatePrimitive.I32); graph.SetArrGetCall(2, 3, 4); graph.SetVarType("y", StatePrimitive.Real); graph.SetDef("y", 4); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StateArray.Of(StatePrimitive.I32)), "x"); result.AssertNamed(StatePrimitive.Real, "y"); }
public void TwoDimention_AnyUpcastArray_ConcreteDef() { TraceLog.IsEnabled = true; // 3 0 2 1 // y:any[] = [1i,[1r]] var graph = new GraphBuilder(); graph.SetConst(0, StatePrimitive.I32); graph.SetConst(1, StatePrimitive.Real); graph.SetSoftArrayInit(2, 1); graph.SetSoftArrayInit(3, 0, 2); graph.SetVarType("y", StateArray.Of(StatePrimitive.Any)); graph.SetDef("y", 3); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNamed(StateArray.Of(StatePrimitive.Any), "y"); result.AssertNode(StateArray.Of(StatePrimitive.Any), 3); result.AssertNode(StateArray.Of(StatePrimitive.Real), 2); }
public void ConcreteCall_WithGenericArray() { // 3 2 0 1 //y = NoNans( [ 1, -1]) var graph = new GraphBuilder(); graph.SetIntConst(0, StatePrimitive.U8); graph.SetIntConst(1, StatePrimitive.I16); graph.SetStrictArrayInit(2, 0, 1); graph.SetCall(new ITicNodeState[] { StateArray.Of(StatePrimitive.Real), StatePrimitive.Bool }, new[] { 2, 3 }); graph.SetDef("y", 3); var result = graph.Solve(); result.AssertNoGenerics(); result.AssertNode(StateArray.Of(StatePrimitive.Real), 2); result.AssertNode(StatePrimitive.Real, 0, 1); result.AssertNamed(StatePrimitive.Bool, "y"); }
public void Generic() { // 3 0 2 1 //y = Map(a, x->x) var graph = new GraphBuilder(); graph.SetVar("a", 0); graph.SetVar("2lx", 1); graph.CreateLambda(1, 2, "2lx"); graph.SetMap(0, 2, 3); graph.SetDef("y", 3); var result = graph.Solve(); var t = result.AssertAndGetSingleGeneric(null, null); result.AssertNamed(StateArray.Of(t), "a", "y"); result.AssertNode(StateFun.Of(t, t)); }
// //////////////////////////////////////////////// //////////////////////// >>>>> initialization Start <<<<< void Start () { mRetryBtn = GameObject.Find("ResultCamera/Retry").gameObject; mQuitBtn = GameObject.Find("ResultCamera/Quit").gameObject; mRetryBtn.active = false; mQuitBtn.active = false; mGoldenballeffUp = (GameObject)Resources.Load("Effect/Mystic"); Ag.SetWorldState("Game"); //------------------------------------------- GetCoin Ag.mIapPrice = 0; Ag.mIAP.mFileIO.mReceipt = "this Receipt"; mGoldenBall = mSilverBall = mBronzeBall = Ag.mBallEventAlready = false; //------------------------------------------- mTimerObj = new AgTime(); //mDragExitBtn = GameObject.Find("UI Root/SingleQuitBtn").gameObject; //mDragExitBtn.SetActiveRecursively(Ag.mSingleMode); Ag.mgEnemGiveup = false; mCurPlayer = Ag.mySelf.mCurPlayer; mCurEnem = Ag.myEnem.mCurPlayer; mAwayEnem = AgUtil.GetMessage("500Game", "AwayEnemy"); mAwaySelf = AgUtil.GetMessage("500Game", "AwayMyself"); mAwayRect = new Rect( Ag.mgScrX*0.2f, Ag.mgScrY*0.2f, Ag.mgScrX*0.6f, Ag.mgScrY*0.5f ); mKplayer = Ag.mySelf.GetGlkper(Ag.mySelf.mGoalUNO); GameInit(); mGodenBallCoin = GameObject.Find("UI Root/GetCoin2").gameObject; mTimerbar.active = false; GameObject.Find("Fadeinout").SendMessage("FadeTest",true,SendMessageOptions.DontRequireReceiver); mKickerInfoBar = (Texture2D)Resources.Load ("UIsource/KICKER_INFOBAR 2"); mAwayPop = AgUtil.GetMessage("100Total", "LeftRoom"); mReconnect = AgUtil.GetMessage("100Total", "Reconnect"); mOK = (Texture2D)Resources.Load("100Total/OkPopup"); // Score Board... float sX = Ag.mgScrX, sY = Ag.mgScrY; float cenX = Ag.mgScrX *0.5f, cenY = Ag.mgScrY*0.03f, vsWid = Ag.mgScrX * 0.5125f , vsHei = Ag.mgScrY * 0.06f, myScrX = vsWid * 0.46f, enScrX = vsWid * 0.42f, siz = vsWid *0.05f; mVSrect = new Rect ( cenX - 0.5f * vsWid, cenY - 0.5f * vsHei, vsWid, vsHei); // Score Board mMyScr = new Rect ( cenX - myScrX, cenY - vsHei * 0.4f, siz*2f, siz*2f); // My Score text mEnScr = new Rect ( cenX + enScrX, cenY - vsHei * 0.4f, siz*2f, siz*2f); // En Score text mAwayPopRect = new Rect( sX*0.18021f, sY*0.30781f, sX*0.63958f, sY*0.38438f); mOkRect = new Rect( sX*0.45547f, sY*0.53f, sX*0.10208f, sY*0.08906f); mSignalStep = vsWid * 0.055f; mSiz = vsWid * 0.037f; // Signal Size.. mMySigX = cenX - vsWid * 0.117f - mSiz*0.5f; // Signal Initial Position (myside) mEnSigX = cenX + vsWid * 0.117f - mSiz*0.5f; // Signal Initial Position (enemy ) mTimer00 = (Texture2D)Resources.Load("Timer/S2"); mTimer01 = (Texture2D)Resources.Load("Timer/S1"); mTimer02 = (Texture2D)Resources.Load ("Timer/S4"); mTimer03 = (Texture2D)Resources.Load ("Timer/S5"); mTimer04 = (Texture2D)Resources.Load ("Timer/S6"); mTimer05 = (Texture2D)Resources.Load ("Timer/S7"); mTimer06 = (Texture2D)Resources.Load ("Timer/S8"); mTimer07 = (Texture2D)Resources.Load ("Timer/S9"); mTimer08 = (Texture2D)Resources.Load ("Timer/10"); mTimer09 = (Texture2D)Resources.Load ("Timer/11c"); mTimer10 = (Texture2D)Resources.Load ("Timer/12c"); mTimer11 = (Texture2D)Resources.Load ("Timer/13c"); mTimer12 = (Texture2D)Resources.Load ("Timer/14c"); mTimer13 = (Texture2D)Resources.Load ("Timer/15c"); mTimer14 = (Texture2D)Resources.Load ("Timer/16c"); mTimer15 = (Texture2D)Resources.Load ("Timer/17c"); mTimer16 = (Texture2D)Resources.Load ("Timer/18c"); mTimer17 = (Texture2D)Resources.Load ("Timer/19c"); mRndBoxpng = (Texture2D)Resources.Load ("TestItem/randombox12"); // Effect Related... mEffect = (Texture2D)Resources.Load ("UISource/LogIn/EFFECT_perfect"); mEffect2 = (Texture2D)Resources.Load ("UISource/EFFECT_buildup"); mEffectPotion = (Texture2D)Resources.Load ("500Game/UI/RedBull_Effect"); mStartTime = Time.timeSinceLevelLoad ; mMissTxr = (Texture2D)Resources.Load ("Effect/Text_Miss"); mGoodTxr = (Texture2D)Resources.Load ("Effect/Text_Good"); mPrftTxr = (Texture2D)Resources.Load ("Effect/Text_Perfect"); mSound = GameObject.Find ("Sound").gameObject.gameObject; mParTicle = GameObject.Find ("Particle System").gameObject.gameObject; mEffPosi = new Vector2(0, 0); mEffSize = new Vector2(0, 0); mEffPosiGood = new Vector2(0, 0); mSound.audio.Pause(); GameObject.Find ("UI Root/MyNick").GetComponent<TextMesh>().text = Ag.mySelf.mNick.ToUpper(); GameObject.Find ("UI Root/EnemyNIck").GetComponent<TextMesh>().text = Ag.myEnem.mNick.ToUpper(); mEventCoin = GameObject.Find("UI Root/GetCoin").gameObject; mMiniItem = GameObject.Find("UI Root/RandomBoxItem").gameObject; mMiniRandomEff = mMiniItem.transform.FindChild("skill01").gameObject; mMiniItem.SetActiveRecursively(false); mCoin100 = (Texture2D)Resources.Load ("TestItem/200coin"); mCoin50 = (Texture2D)Resources.Load ("TestItem/50coin"); mCoin20 = (Texture2D)Resources.Load ("TestItem/20coin"); mGameObj = GameObject.Find("RandomBox").gameObject; mGameObj2 = GameObject.Find("RandomBox2").gameObject; mItem = mGameObj.transform.FindChild("ItemBox1").gameObject; mBallItem = mGameObj.transform.FindChild("mkball1").gameObject; mParticle = mGameObj.transform.FindChild("mkball1/Particle1").gameObject; mDirUpeff = (GameObject)Resources.Load("Effect/DirUp"); mSkillUpeff = (GameObject)Resources.Load("Effect/SuperB"); //mMiniItem.SetActiveRecursively(false); mGameObj.SetActive(false); //mGameObj2.SetActive(false); GameObjectRndBox(false); //mEventBallEffect = GameObject.Find("UI Root/accfast").gameObject; #if UNITY_IPHONE mGuiCur = Ag.mgIsRetina? mGuiBig: mGuiSml; #endif #if UNITY_ANDROID mGuiCur = mGuiBig; #endif /* // Wagu.... float waguX = mSX * mPlayerInfoX, waguY = mSY * 0.1f, waguWid = mSX * 0.28f, waguHei = mSY * 0.15f; mWaguRec = new Rect( waguX, waguY, waguWid, waguHei ); // Player Picture.. depend on Wagu Size, and Position... float picX = waguWid * 0.05f, picY = waguHei * 0.3f, picWid = waguWid * 0.2f, picHei = waguHei * 0.6f; mPicRec = new Rect( waguX+picX, waguY+picY, picWid, picHei ); // Direction Bar float dirX = waguWid * 0.27f, dirY = waguHei * 0.6f, dirWid = waguWid * 0.7f, dirHei = waguHei * 0.3f; mDirRec = new Rect( waguX+dirX, waguY+dirY, dirWid, dirHei ); mEnemyBioRec = new Rect (waguX+dirX, waguY+picY, picWid, picHei * 0.45f ); */ /* mPlayerKicker.animation.Play ("cerlose01"); mPlayerKeeper.animation.Play ("CerKeeperA_L"); CerCam.animation.Play ("C_Keeper_Cer1_L"); //CerCam.animation.Play ("C_Kicker_DisC_R"); return; */ mPerfectNum = mMissNum = mPreMyWin = mPreEnWin = 0; Ag.mgStepSend = 1; Ag.LogNewScene("Game310_2", "Start"); //mStateCere = new StateArray(); mStateArr = new StateArray(); mStage = new AmStage(); mStage.arrTheState = mStateArr; SetStateArray(); // Set State Machine ...... SetArrTexture(); // Set Texture Array... mCerCamAxis.SetActiveRecursively(false); FieldChanged (false); }
void KeeperAction() { mStateCere = new StateArray(); mRotSpeed = 1.2f; mStateCere.AddAMember("Init", 4f); mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } ); mStateCere.AddAMember("Clock", 0.5f); mStateCere.AddEntryAction( ()=> { mRotSpeed = 1.2f; } ); mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } ); mStateCere.AddAMember("Counter", 0.5f); mStateCere.AddEntryAction( ()=> { mRotSpeed = -0.85f; } ); mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } );; mStateCere.SetNextStateOf("Init", "Counter"); mStateCere.SetNextStateOf("Clock", "Counter"); mStateCere.SetNextStateOf("Counter", "Clock"); mStateCere.SetStateWithNameOf("Init"); }
// //////////////////////////////////////////////// State Array Setting... void SetStateArray() { mSttArr = new StateArray(); mSttArr.AddAMember("InitPurchase", 3f); mSttArr.AddExitCondition( ()=> { return !Ag.mIAP.mIsUiLocked; }); mSttArr.AddTimeOutProcess(20f, ()=> { // Go to Next Stage.. }); mSttArr.AddAMember("CheckFile", 5f); mSttArr.AddEntryAction( ()=>{ Ag.mIAP.CheckUnsentTransaction(); }); mSttArr.AddExitCondition( ()=>{ if (Ag.mIAP.mIsUiLocked) Application.LoadLevel("menu"); return true; } ); mSttArr.AddAMember("Rest", 0f); mSttArr.AddExitCondition( ()=> { return false; } ); mSttArr.SetSerialExitMember( pClose:false ); mSttArr.SetStateWithNameOf("Rest"); }
public override void Venture(int pF, int pL) { // 1 + 1 = 2 arrStt = new StateArray (); arrStt.AddAMemberAndEntryAction ("Init", 0.5f, "Normal", () => { Ag.LogIntenseWord(" >> Start << mMpsFormat = new MdFormatter (pF, pL); "); mMpsFormat = new MdFormatter (pF, pL, Godirum.PLU); JJ.Init (); Ag.LogIntenseWord(" >> End << mMpsFormat = new MdFormatter (pF, pL); "); }); arrStt.AddAMemberAndEntryAction ("GetChubang", 0.1f, "Normal", () => { mCurChubang = mMpsFormat.GetChubang (); }); arrStt.AddAMemberAndEntryAction ("ChubangInit", 1f, "Normal", () => { Ag.LogIntenseWord(" >> Start << ChubangInit "); mForm = mRscrcMan.GetFriend(mCurChubang.mFff); // Add Script, Variable.. mForm.transform.SetAeDora(mCurChubang.mFvr); mForm.GetComponent<HtFriendIdv>().LoadEyes(arrEyeObj); mLatt = mRscrcMan.GetFriend(mCurChubang.mLff); mLatt.transform.SetAeDora(mCurChubang.mLvr); mLatt.GetComponent<HtFriendIdv>().LoadEyes(arrEyeObj); SetGod(Godirum.PLU); }); arrStt.AddAMemberAndEntryAction ("JinsimIntro", 0.5f, "Normal", () => { Ag.LogIntenseWord(" >> Start << JinsimIntro "); mForm.SetState(arrStt.GetCurStateName()); // MoveBack Start mLatt.SetState(arrStt.GetCurStateName()); ReplaceAllEyes(); // Jinsim Array Creation.. Assign Range .. ... arrJsObj = mForm.GetComponent<HtFriendIdv>().CreateJinsim(); arrJsObj.AddRange(mLatt.GetComponent<HtFriendIdv>().CreateJinsim() ); SetGod(Godirum.PLU); //Ag.LogIntenseWord(" Jinsim Count " + arrJsObj.Count); }); //arrStt.AddAMemberAndEntryAction ("JinsimJumbi", 0.5f, "Normal", () => { // <<<<< F L 없어지고 Hon 출현 >>>>> arrStt.AddAMemberAndEntryAction ("JinsimJumbi", 2f, "Normal", () => { // <<<<< F L 없어지고 Hon 출현 >>>>> Ag.LogIntenseWord(" >> Start << JinsimJumbi "); mForm.SetState(arrStt.GetCurStateName()); // Destroyed ... mLatt.SetState(arrStt.GetCurStateName()); (" JinsimJumbi >>>> mCurChubang.mRff :: " + mCurChubang.mHff.ToString()).HtLog(); // ----- Instantiate ___ Hon ___ ----- // mHon = mRscrcMan.GetFriend(mCurChubang.mHff); // Add Script, Variable.. mHon.transform.SetAeDora(mCurChubang.mHonVr); mHon.GetComponent<HtFriendIdv>().LoadEyes(null, pIsHon:true); // This is Result Eyes ... SetGod(Godirum.PLU); mHon.SetTarget(mCurChubang.mHTarVr); List<VecRot> honVecrot = mHon.GetComponent<HtFriendIdv>().HonPosition(pIsOver10:(mCurChubang.mKind == Cb.PLUS_OVER10) ); List<VecRot> honEyeVect = mHon.GetComponent<HtFriendIdv>().HonEyePosition(pIsOver10:(mCurChubang.mKind == Cb.PLUS_OVER10) ); // Hon Eye Positions. int k=0; // Is Over 10 ... if (mCurChubang.mKind == Cb.PLUS_OVER10) { m10obj = mRscrcMan.GetComPrefab ("Friends", Fff.TEN.ToString() ); m10obj.transform.SetAeDora(mCurChubang.mHonVr); for(int jk=0; jk<10; jk++) { arrJsObj[jk].transform.parent = m10obj.transform; } } foreach(GameObject jsgo in arrJsObj) { // Set Targets of Jinsims... jsgo.SetTarget(honVecrot[k++]); } k=0; foreach(GameObject jsgo in arrEyeObj) { // 9 EyeSingle in arrEyeObj ... 3 EyeTriple in honEyeVect ... //(" JinsimJumbi >> honEyeVect " + honEyeVect.Count + " , k = " + k).HtLog(); VecRot tar = honEyeVect[k].GetEyeTargetFromHon(); if (tar == null) { tar = honEyeVect[++k].GetEyeTargetFromHon(); //(" JinsimJumbi >> k++ " + k).HtLog(); } jsgo.SetTarget(tar); //jsgo.SetTarget(honEyeVect[k++]); } SetStateOfObjects(); }); arrStt.AddAMemberAndEntryAction ("JinsimChum", 5f, "Normal", () => { Ag.LogIntenseWord(" >> Start << JinsimChum "); SetStateOfObjects(); if (mCurChubang.mKind == Cb.PLUS_OVER10) { arrStt.SetNextStateOf("JinsimChum", "Make10"); } }); arrStt.AddAMemberAndEntryAction ("Result", 2f, "Normal", () => { SetStateOfObjects(); }); arrStt.AddAMemberAndEntryAction ("ShowResult", 2f, "Normal", () => { //arrStt.SetStateWithNameOf("Init"); SetStateOfObjects(); }); arrStt.AddAMemberAndEntryAction ("DestroyAll", 1f, "Normal", () => { DestroyAll(); }); arrStt.AddAMemberAndEntryAction ("RestInPeace", 0f, "Normal", () => { }); arrStt.AddAMemberAndEntryAction ("Make10", 2f, "Normal", () => { // Additional State ... SetStateOfObjects(); }); arrStt.SetSerialExitMember (); arrStt.SetStateWithNameOf ("Init"); }