public Formation.IFormation Parse(List <DataContext.Card> cards) { var pairs = new Formation.FormationPair[cards.Count / 2]; for (int i = 0; i < pairs.Length; i++) { pairs[i] = new Formation.FormationPair(cards[2 * i], cards[2 * i + 1]); } return(new Formation.FormationSequenceOfPair(pairs)); }
private IFormation GetFormation(List <Card> cards, int continuousThreeIndex) { var tmp = new Dictionary <int, int[]>(); tmp[0] = new int[] { 3, 4 }; tmp[1] = new int[] { 0, 4 }; tmp[2] = new int[] { 0, 1 }; var pair = new Formation.FormationPair(cards[tmp[continuousThreeIndex][0]], cards[tmp[continuousThreeIndex][1]]); return(new Formation.FormationThree(cards.GetRange(continuousThreeIndex, 3).ToArray(), pair)); }