Example #1
0
 public void Read (TProtocol iprot)
 {
   iprot.IncrementRecursionDepth();
   try
   {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
       field = iprot.ReadFieldBegin();
       if (field.Type == TType.Stop) { 
         break;
       }
       switch (field.ID)
       {
         case 1:
           if (field.Type == TType.I32) {
             Sangcharim = (Sangcharim)iprot.ReadI32();
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         default: 
           TProtocolUtil.Skip(iprot, field.Type);
           break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
   }
   finally
   {
     iprot.DecrementRecursionDepth();
   }
 }
Example #2
0
	void UpdateMapForSangcharim(Sangcharim cho, Sangcharim han)
	{
		switch (cho)
		{
		case Sangcharim.kSMSM:
			map[1] = Jg.ChoSang;
			map[2] = Jg.ChoMa;
			map[6] = Jg.ChoSang;
			map[7] = Jg.ChoMa;
			break;
		case Sangcharim.kMSMS:
			map[1] = Jg.ChoMa;
			map[2] = Jg.ChoSang;
			map[6] = Jg.ChoMa;
			map[7] = Jg.ChoSang;
			break;
		case Sangcharim.kMSSM:
			map[1] = Jg.ChoMa;
			map[2] = Jg.ChoSang;
			map[6] = Jg.ChoSang;
			map[7] = Jg.ChoMa;
			break;
		case Sangcharim.kSMMS:
			map[1] = Jg.ChoSang;
			map[2] = Jg.ChoMa;
			map[6] = Jg.ChoMa;
			map[7] = Jg.ChoSang;
			break;
		}
		switch (han)
		{
		case Sangcharim.kSMSM:
			map[91] = Jg.ChoSang+10;
			map[92] = Jg.ChoMa+10;
			map[96] = Jg.ChoSang+10;
			map[97] = Jg.ChoMa+10;
			break;
		case Sangcharim.kMSMS:
			map[91] = Jg.ChoMa+10;
			map[92] = Jg.ChoSang+10;
			map[96] = Jg.ChoMa+10;
			map[97] = Jg.ChoSang+10;
			break;
		case Sangcharim.kMSSM:
			map[91] = Jg.ChoMa+10;
			map[92] = Jg.ChoSang+10;
			map[96] = Jg.ChoSang+10;
			map[97] = Jg.ChoMa+10;
			break;
		case Sangcharim.kSMMS:
			map[91] = Jg.ChoSang+10;
			map[92] = Jg.ChoMa+10;
			map[96] = Jg.ChoMa+10;
			map[97] = Jg.ChoSang+10;
			break;
		}
	}
Example #3
0
	public void SetSangcharim(bool iAmCho, Sangcharim me, Sangcharim opponent)
	{
		SetSangcharimImpl(iAmCho, me, opponent);
	}
Example #4
0
	void SetSangcharimImpl(bool iAmCho, Sangcharim me, Sangcharim opponent)
	{
		Debug.Log(string.Format("SetSangcharim {0}/{1} \n", me, opponent));
		
		GameObject.Destroy(piecesInMap[1].gameObject);
		GameObject.Destroy(piecesInMap[2].gameObject);
		GameObject.Destroy(piecesInMap[6].gameObject);
		GameObject.Destroy(piecesInMap[7].gameObject);
		
		if (iAmCho)
		{
			//			if (me == Sangcharim.kSMSM && opponent == Sangcharim.kSMSM)
			//			else
			{
				switch (me)
				{
				case Sangcharim.kSMSM:
					piecesInMap[1] = CreatePawn(Jg.ChoSang, 1);
					piecesInMap[2] = CreatePawn(Jg.ChoMa, 2);
					piecesInMap[6] = CreatePawn(Jg.ChoSang, 6);
					piecesInMap[7] = CreatePawn(Jg.ChoMa, 7);
					break;
				case Sangcharim.kMSMS:
					piecesInMap[1] = CreatePawn(Jg.ChoMa, 1);
					piecesInMap[2] = CreatePawn(Jg.ChoSang, 2);
					piecesInMap[6] = CreatePawn(Jg.ChoMa, 6);
					piecesInMap[7] = CreatePawn(Jg.ChoSang, 7);
					break;
				case Sangcharim.kMSSM:
					piecesInMap[1] = CreatePawn(Jg.ChoMa, 1);
					piecesInMap[2] = CreatePawn(Jg.ChoSang, 2);
					piecesInMap[6] = CreatePawn(Jg.ChoSang, 6);
					piecesInMap[7] = CreatePawn(Jg.ChoMa, 7);
					break;
				case Sangcharim.kSMMS:
					piecesInMap[1] = CreatePawn(Jg.ChoSang, 1);
					piecesInMap[2] = CreatePawn(Jg.ChoMa, 2);
					piecesInMap[6] = CreatePawn(Jg.ChoMa, 6);
					piecesInMap[7] = CreatePawn(Jg.ChoSang, 7);
					break;
				}
				switch (opponent)
				{
				case Sangcharim.kSMSM:
					piecesInMap[91] = CreatePawn(Jg.HanSang, 91);
					piecesInMap[92] = CreatePawn(Jg.HanMa, 92);
					piecesInMap[96] = CreatePawn(Jg.HanSang, 96);
					piecesInMap[97] = CreatePawn(Jg.HanMa, 97);
					break;
				case Sangcharim.kMSMS:
					piecesInMap[91] = CreatePawn(Jg.HanMa, 91);
					piecesInMap[92] = CreatePawn(Jg.HanSang, 92);
					piecesInMap[96] = CreatePawn(Jg.HanMa, 96);
					piecesInMap[97] = CreatePawn(Jg.HanSang, 97);
					break;
				case Sangcharim.kMSSM:
					piecesInMap[91] = CreatePawn(Jg.HanMa, 91);
					piecesInMap[92] = CreatePawn(Jg.HanSang, 92);
					piecesInMap[96] = CreatePawn(Jg.HanSang, 96);
					piecesInMap[97] = CreatePawn(Jg.HanMa, 97);
					break;
				case Sangcharim.kSMMS:
					piecesInMap[91] = CreatePawn(Jg.HanSang, 91);
					piecesInMap[92] = CreatePawn(Jg.HanMa, 92);
					piecesInMap[96] = CreatePawn(Jg.HanMa, 96);
					piecesInMap[97] = CreatePawn(Jg.HanSang, 97);
					break;
				}
			}
		}
		else
		{
			if (me == Sangcharim.kSMSM && opponent == Sangcharim.kSMSM)
			{
			}
			else
			{
				switch (me)
				{
				case Sangcharim.kSMSM:
					piecesInMap[91] = CreatePawn(Jg.ChoSang+10, 91);
					piecesInMap[92] = CreatePawn(Jg.ChoMa+10, 92);
					piecesInMap[96] = CreatePawn(Jg.ChoSang+10, 96);
					piecesInMap[97] = CreatePawn(Jg.ChoMa+10, 97);
					break;
				case Sangcharim.kMSMS:
					piecesInMap[91] = CreatePawn(Jg.ChoMa+10, 91);
					piecesInMap[92] = CreatePawn(Jg.ChoSang+10, 92);
					piecesInMap[96] = CreatePawn(Jg.ChoMa+10, 96);
					piecesInMap[97] = CreatePawn(Jg.ChoSang+10, 97);
					break;
				case Sangcharim.kMSSM:
					piecesInMap[91] = CreatePawn(Jg.ChoMa+10, 91);
					piecesInMap[92] = CreatePawn(Jg.ChoSang+10, 92);
					piecesInMap[96] = CreatePawn(Jg.ChoSang+10, 96);
					piecesInMap[97] = CreatePawn(Jg.ChoMa+10, 97);
					break;
				case Sangcharim.kSMMS:
					piecesInMap[91] = CreatePawn(Jg.ChoSang+10, 91);
					piecesInMap[92] = CreatePawn(Jg.ChoMa+10, 92);
					piecesInMap[96] = CreatePawn(Jg.ChoMa+10, 96);
					piecesInMap[97] = CreatePawn(Jg.ChoSang+10, 97);
					break;
				}
				switch (opponent)
				{
				case Sangcharim.kSMSM:
					piecesInMap[91] = CreatePawn(Jg.HanSang-10, 91);
					piecesInMap[92] = CreatePawn(Jg.HanMa-10, 92);
					piecesInMap[96] = CreatePawn(Jg.HanSang, 96);
					piecesInMap[97] = CreatePawn(Jg.HanMa, 97);
					break;
				case Sangcharim.kMSMS:
					piecesInMap[91] = CreatePawn(Jg.HanMa, 91);
					piecesInMap[92] = CreatePawn(Jg.HanSang, 92);
					piecesInMap[96] = CreatePawn(Jg.HanMa, 96);
					piecesInMap[97] = CreatePawn(Jg.HanSang, 97);
					break;
				case Sangcharim.kMSSM:
					piecesInMap[91] = CreatePawn(Jg.HanMa, 91);
					piecesInMap[92] = CreatePawn(Jg.HanSang, 92);
					piecesInMap[96] = CreatePawn(Jg.HanSang, 96);
					piecesInMap[97] = CreatePawn(Jg.HanMa, 97);
					break;
				case Sangcharim.kSMMS:
					piecesInMap[91] = CreatePawn(Jg.HanSang, 91);
					piecesInMap[92] = CreatePawn(Jg.HanMa, 92);
					piecesInMap[96] = CreatePawn(Jg.HanMa, 96);
					piecesInMap[97] = CreatePawn(Jg.HanSang, 97);
					break;
				}
			}
		}
	}