// File: kongrigoriou[P]Text-Based-RPG/src/Grid.cpp
// Function: Grid::Grid(Market*, Squad*)
Grid::Grid(Market* m, Squad* sq){
    market = m;
    team = sq;

    Map = new int*[HEIGHT];                 //creating the map

    for(int i = 0; i < HEIGHT; i++){
        Map[i] = new int [WIDTH];
    }
    srand(time(NULL));

    for(int x = 0; x < HEIGHT; x++){
        for(int y = 0; y < WIDTH; y++){
            int p;                          //possibility
            p = rand()%100;

            if(p <= 15 ){
                Map[x][y] = 0;
            }else if(p <= 35){
                Map[x][y] = 2;
            }else{
                Map[x][y] = 1;
            }
        }
    }
    x = 0;
    y= 0;
    Map[0][0] = 1;
    pt = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
callq 0x116e0
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x60(%rbp)
callq 0x116e0
movq -0x48(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x58(%rbp)
callq 0x116e0
movq -0x48(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x50(%rbp)
callq 0x116e0
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x70(%rax)
movl $0x28, %edi
callq 0x3030
movq %rax, -0x40(%rbp)
jmp 0xe99f
movq -0x68(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x60(%rax)
movl $0x0, -0x28(%rbp)
cmpl $0x5, -0x28(%rbp)
jge 0xea1c
movl $0x14, %edi
callq 0x3030
movq %rax, -0x70(%rbp)
jmp 0xe9c8
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe9b2
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x11700
movq -0x58(%rbp), %rdi
callq 0x11700
movq -0x60(%rbp), %rdi
callq 0x11700
movq -0x48(%rbp), %rdi
callq 0x11700
jmp 0xeb10
xorl %eax, %eax
movl %eax, %edi
callq 0x31c0
movl %eax, %edi
callq 0x31d0
movl $0x0, -0x2c(%rbp)
cmpl $0x5, -0x2c(%rbp)
jge 0xeae1
movl $0x0, -0x30(%rbp)
cmpl $0x5, -0x30(%rbp)
jge 0xead1
callq 0x3070
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, -0x34(%rbp)
cmpl $0xf, -0x34(%rbp)
jg 0xea81
movq -0x68(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0xeac1
cmpl $0x23, -0x34(%rbp)
jg 0xeaa4
movq -0x68(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl $0x2, (%rax,%rcx,4)
jmp 0xeabf
movq -0x68(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0xeac1
jmp 0xeac3
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xea44
jmp 0xead3
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xea33
movq -0x68(%rbp), %rax
movl $0x0, 0x78(%rax)
movl $0x0, 0x7c(%rax)
movq 0x60(%rax), %rcx
movq (%rcx), %rcx
movl $0x1, (%rcx)
movl $0x1, 0x88(%rax)
addq $0x70, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3330
nopl (%rax)