public Piece(PieceVariantModel model, Team owningTeam) { VariantId = model.VariantId; Name = model.Name; CaptureDoesGivePoint = model.CaptureDoesGivePoint; CapturePointValue = model.CapturePointValue; MoveAbilities = model.MoveAbilities; TeamId = owningTeam.Id; }
public static Piece GenerateWhale(Match match, Team team) { var whaleModel = new PieceVariantModel(); whaleModel.VariantId = 22; whaleModel.CaptureDoesGivePoint = true; whaleModel.CapturePointValue = 1; var whaleName = ""; var xChange = 0; if (team.Id == 0) { whaleName = "red whale"; } else if (team.Id == 1) { whaleName = "blue whale"; } whaleModel.Name = whaleName; whaleModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 1, multiplicity: 10)); whaleModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: -1, multiplicity: 10)); whaleModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: -1, multiplicity: 10)); whaleModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 1, multiplicity: 10)); return new Piece(whaleModel, team); }
public static Piece GenerateSherman(Match match, Team team) { var shermanModel = new PieceVariantModel(); shermanModel.VariantId = 11; shermanModel.Name = "Sherman Tank"; shermanModel.CaptureDoesGivePoint = true; shermanModel.CapturePointValue = 1; if (match.IsTeam1(team)) { // UPRIGHT 3 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: -1, multiplicity: 2)); // DOWN 3 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 0, multiplicity: 3)); // UPLEFT 3 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 1, multiplicity: 2)); } else { // DOWNRIGHT 3 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: -1, multiplicity: 2)); // UP 3 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 0, multiplicity: 3)); // DOWNLEFT 2 shermanModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 1, multiplicity: 2)); } return new Piece(shermanModel, team); }
public static Piece GenerateRook(Match match, Team team) { var rookName = ""; if (team.Id == 0) { rookName = "red Rook"; } else if (team.Id == 1) { rookName = "blue Rook"; } var rookModel = new PieceVariantModel(); rookModel.VariantId = 2; rookModel.Name = rookName; // UP infinitely rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: 1, multiplicity: 7)); // RIGHT infinitely rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 0, multiplicity: 7)); // DOWN infinitely rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: -1, multiplicity: 7)); // LEFT infinitely rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 0, multiplicity: 7)); return new Piece(rookModel, team); }
public static Piece GenerateBishop(Match match, Team team) { var bishopName = ""; if (team.Id == 0) { bishopName = "red Bishop"; } else if (team.Id == 1) { bishopName = "blue Bishop"; } var bishopModel = new PieceVariantModel(); bishopModel.VariantId = 4; bishopModel.Name = bishopName; // UPRIGHT infinitely bishopModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 1, multiplicity: 7)); // DOWNRIGHT infinitely bishopModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: -1, multiplicity: 7)); // DOWNLEFT infinitely bishopModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: -1, multiplicity: 7)); // UPLEFT infinitely bishopModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 1, multiplicity: 7)); return new Piece(bishopModel, team); }
public static Piece GenerateQueen(Match match, Team team) { var queenName = ""; if (team.Id == 0) { queenName = "red Queen"; } else if (team.Id == 1) { queenName = "blue Queen"; } var queenModel = new PieceVariantModel(); queenModel.VariantId = 6; queenModel.Name = queenName; // UP infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: 1, multiplicity: 8)); // UPRIGHT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 1, multiplicity: 8)); // RIGHT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 0, multiplicity: 8)); // DOWNRIGHT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: -1, multiplicity: 8)); // DOWN infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: -1, multiplicity: 8)); // DOWNLEFT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: -1, multiplicity: 8)); // LEFT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 0, multiplicity: 8)); // UPLEFT infinitely queenModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 1, multiplicity: 8)); return new Piece(queenModel, team); }
// TODO: to account for cases like the pawn's 2y move, both the 1y and the 2y have to be one distinct moveability. // Somehow need to track different bools for each multiplicity. public static Piece GeneratePawn(Match match, Team team) { var pawnName = ""; var yChange = 0; if (team.Id == 0) { pawnName = "red Pawn"; yChange = -1; } else if (team.Id == 1) { pawnName = "blue Pawn"; yChange = 1; } var pawnModel = new PieceVariantModel(); pawnModel.VariantId = 1; pawnModel.Name = pawnName; // DOWN 1 or DOWN 2 pawnModel.MoveAbilities.Add(new MoveAbility( canCapture: false, moveOnly: true, captureOnly: false, canHop: false, firstMoveOnly: true, xChange: 0, yChange: yChange*2, multiplicity: 1)); // DOWN 1 pawnModel.MoveAbilities.Add(new MoveAbility( canCapture: false, moveOnly: true, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: yChange, multiplicity: 1)); // DOWN 1, LEFT 1 pawnModel.MoveAbilities.Add(new MoveAbility(multiplicity: 1, canCapture: true, moveOnly: false, captureOnly: true, canHop: false, firstMoveOnly: false, xChange: -1, yChange: yChange)); // DOWN 1, RIGHT 1 pawnModel.MoveAbilities.Add(new MoveAbility(multiplicity: 1, canCapture: true, moveOnly: false, captureOnly: true, canHop: false, firstMoveOnly: false, xChange: 1, yChange: yChange)); return new Piece(pawnModel, team); }
public static Piece GenerateKnight(Match match, Team team) { var knightName = ""; if (team.Id == 0) { knightName = "red Knight"; } else if (team.Id == 1) { knightName = "blue Knight"; } var rookModel = new PieceVariantModel(); rookModel.VariantId = 3; rookModel.Name = knightName; // UP, UP, RIGHT rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: 1, yChange: 2, multiplicity: 1)); // RIGHT, RIGHT, UP rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: 2, yChange: 1, multiplicity: 1)); // RIGHT RIGHT DOWN rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: 2, yChange: -1, multiplicity: 1)); // DOWN DOWN RIGHT rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: 1, yChange: -2, multiplicity: 1)); // DOWN DOWN LEFT rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: -1, yChange: -2, multiplicity: 1)); // LEFT LEFT DOWN rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: -2, yChange: -1, multiplicity: 1)); // LEFT LEFT UP rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: -2, yChange: 1, multiplicity: 1)); // UP UP LEFT rookModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: true, firstMoveOnly: false, xChange: -1, yChange: 2, multiplicity: 1)); return new Piece(rookModel, team); }
public static Piece GenerateKing(Match match, Team team) { var kingName = ""; if (team.Id == 0) { kingName = "red King"; } else if (team.Id == 1) { kingName = "blue King"; } var kingModel = new PieceVariantModel(); kingModel.VariantId = 5; kingModel.Name = kingName; kingModel.CaptureDoesGivePoint = true; kingModel.CapturePointValue = 1; // UP 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: 1, multiplicity: 1)); // UPRIGHT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 1, multiplicity: 1)); // RIGHT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: 0, multiplicity: 1)); // DOWNRIGHT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 1, yChange: -1, multiplicity: 1)); // DOWN 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: 0, yChange: -1, multiplicity: 1)); // DOWNLEFT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: -1, multiplicity: 1)); // LEFT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 0, multiplicity: 1)); // UPLEFT 1 kingModel.MoveAbilities.Add(new MoveAbility( canCapture: true, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: -1, yChange: 1, multiplicity: 1)); return new Piece(kingModel, team); }
public static Piece GenerateFish(Match match, Team team) { var fishModel = new PieceVariantModel(); fishModel.VariantId = 21; var fishName = ""; var xChange = 0; if (team.Id == 0) { fishName = "red fish"; xChange = 2; } else if (team.Id == 1) { fishName = "blue fish"; xChange = -2; } if (match.IsTeam1(team)) { fishModel.Name = fishName; fishModel.MoveAbilities.Add(new MoveAbility( canCapture: false, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: xChange, yChange: 0, multiplicity: 1)); } else { fishModel.Name = fishName; fishModel.MoveAbilities.Add(new MoveAbility( canCapture: false, moveOnly: false, captureOnly: false, canHop: false, firstMoveOnly: false, xChange: xChange, yChange: 0, multiplicity: 1)); } return new Piece(fishModel, team); }