Exemple #1
0
		}// LateUpdate



		protected void CreateInfrastructure() {

			Vector3 offsetBoard = Vector3.zero;
			offsetBoard.x = -0.5f * (CardOnBoardOffset.x * (ParamBoardColumns-1));
			offsetBoard.z = -0.5f * (CardOnBoardOffset.z * (ParamBoardRows-1));
			_cardViewsBoard = new CardView[ParamBoardRows][];
			for (int row = 0; row < ParamBoardRows; row++){
				_cardViewsBoard [row] = new CardView[ParamBoardColumns];
				for (int col = 0; col < ParamBoardColumns; col++) {
					CardView cv = SpawnCard (
						(CardColor)System.Enum.ToObject (typeof(CardColor), MathHelper.Rand.Next(System.Enum.GetNames (typeof(CardColor)).Length-1)+1),
						MathHelper.Rand.Next(ParamCardsMaxValue - ParamCardsMinValue) +1 +ParamCardsMinValue
						);
					cv.transform.position =
						ParentBoard.transform.position 
						+ offsetBoard
						+ new Vector3(col * CardOnBoardOffset.x, 0.0f, row * CardOnBoardOffset.z);
					cv.transform.rotation = Quaternion.Euler (CardOnBoardRotation);
					cv.transform.SetParent(ParentBoard.transform, true);

					cv.gameObject.name = "CardBoard_" + col + "_" + row;

					_cardViewsBoard [row] [col] = cv;
					_cardViewsBoard [row] [col].Column = col;
					_cardViewsBoard [row] [col].Row = row;
				}// for
			}// for

			_cardViewsPerPlayer = new List<CardView>[ParamPlayerCount];
			for (int p = 0; p < ParamPlayerCount; p++) {
				_cardViewsPerPlayer[p] = new List<CardView>();
				for (int pc = 0; pc < ParamCardsPerPlayer; pc++) {

					AddCardView(p,
						(CardColor)System.Enum.ToObject (typeof(CardColor), MathHelper.Rand.Next(System.Enum.GetNames (typeof(CardColor)).Length-1)+1),
						MathHelper.Rand.Next(ParamCardsMaxValue - ParamCardsMinValue) +1 +ParamCardsMinValue);
					/*
					CardView cv = SpawnCard (
						(CardColor)System.Enum.ToObject (typeof(CardColor), MathHelper.Rand.Next(System.Enum.GetNames (typeof(CardColor)).Length-1)+1),
						MathHelper.Rand.Next(ParamCardsMaxValue - ParamCardsMinValue) +1 +ParamCardsMinValue
					);

					int row = Mathf.FloorToInt (((float)pc) / ((float)CardsMaxPerRow));
					cv.transform.position =
						//ParentPlayerHands[p].transform.position +
						new Vector3((pc % CardsMaxPerRow)* CardPlayerHandOffset.x, CardPlayerHandOffset.y, row * CardPlayerHandOffset.z);
					cv.transform.rotation = Quaternion.Euler (CardPlayerHandRotation);// + ParentPlayerHands[p].transform.rotation.eulerAngles);
					cv.transform.SetParent(ParentPlayerHands[p].transform, false);

					cv.gameObject.name = "CardPlayer_" + p + "_" + pc;

					_cardViewsPerPlayer [p].Add(cv);
					*/
				}// for
			}// for

			//AudioHelper.AssignSfx(this.gameObject, ref _asApplause, SfxApplause);
		}// CreateInfrastructure
Exemple #2
0
		}// CheckPlayerCanPlay



		protected bool DoCheckCardFits(Card selected, CardView cv){
			return
				ValidateRoutine_Common(selected, cv.CardModel, cv.Column, cv.Row)
				&& (_match.GetPlayer(_match.PlayerAction).Routine.Validator(selected, cv.CardModel, cv.Column, cv.Row))
				;
		}// DoCheckCardFits