<commit_before>//
//  EmojieMemoryGameView.swift
//  Memorize
//
//  Created by <NAME> on 29/05/2020.
//  Copyright © 2020 vmachiel. All rights reserved.
//  THERE WILL BE TOO MANY COMMENTS, THIS IS A LEARNING EXPERIENCE

import SwiftUI

struct EmojiMemoryGameView: View {
    // The some is to indicate it needs to be some kind of view.
    // It can be a combination of all sorts of Views, as long as it's a View. (Lego analogy).
    // Views aren't stored but computed: everytime body is request its contents
    // get executed and returned. When type of view it is, depends on execution
    
    // The viewmodel: the connection to the model!!  Pointer to the EmojiMemoryGame
    // The actual game is inited in SceneDelegate!!!!
    // ObservedObject property wrapper says: this contains an observableobject (view of type: EmojiMemoryGame)
    // So keep track of that observableoject and redraw when it calls a objectWillChange.send()
    // ONLY the changed card is redrawn: it's Identifiable, so swiftUI knows which one has
    // changed. 
    @ObservedObject var viewModel: EmojiMemoryGame
    
    var body: some View {
        // A horizontal stack
        HStack {
            // For each makes a number of views, but doesn't do the layout
            // That's the level above. This makes a number of CardViews
            // cards need to be made indenfiable 
            ForEach(viewModel.cards) { card in
                // ontap makes the choose method run for each card.
                CardView(card: card).onTapGesture {
                     viewModel.choose(card: card)}
            }
        }
            
            // Every view inside all of the stracks get these methods
            .padding()  // Space between the edge and object.
            .foregroundColor(Color.orange) // default color.
    }<commit_msg>Added aspect ratio to cards<commit_after>//
//  EmojieMemoryGameView.swift
//  Memorize
//
//  Created by <NAME> on 29/05/2020.
//  Copyright © 2020 vmachiel. All rights reserved.
//  THERE WILL BE TOO MANY COMMENTS, THIS IS A LEARNING EXPERIENCE

import SwiftUI

struct EmojiMemoryGameView: View {
    // The some is to indicate it needs to be some kind of view.
    // It can be a combination of all sorts of Views, as long as it's a View. (Lego analogy).
    // Views aren't stored but computed: everytime body is request its contents
    // get executed and returned. When type of view it is, depends on execution
    
    // The viewmodel: the connection to the model!!  Pointer to the EmojiMemoryGame
    // The actual game is inited in SceneDelegate!!!!
    // ObservedObject property wrapper says: this contains an observableobject (view of type: EmojiMemoryGame)
    // So keep track of that observableoject and redraw when it calls a objectWillChange.send()
    // ONLY the changed card is redrawn: it's Identifiable, so swiftUI knows which one has
    // changed. 
    @ObservedObject var viewModel: EmojiMemoryGame
    // MARK: Constants of the EmojieMemoryGameView
    let aspectRatio: CGFloat = 2/3
    
    var body: some View {
        // A horizontal stack
        HStack {
            // For each makes a number of views, but doesn't do the layout
            // That's the level above. This makes a number of CardViews
            // cards need to be made indenfiable 
            ForEach(viewModel.cards) { card in
                // ontap makes the choose method run for each card.
                CardView(card: card).onTapGesture {
                     viewModel.choose(card: card)}
            }
        }
            
            // Every view inside all of the stracks get these methods
            .padding()  // Space between the edge and object.
            .foregroundColor(Color.orange) // default color.
        .aspectRatio(aspectRatio, contentMode: .fit)
    }
{'fraction_non_alphanumeric': 0.07092568448500652, 'fraction_numerical': 0.006779661016949152, 'mean_word_length': 2.186046511627907, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5314298', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1012, 'n_words': 456}