Package view

Source Code of view.test_frame

package view;

import game_model.field_model;
import game_model.position;
import java.awt.Color;
import java.io.IOException;
import java.util.ArrayList;

import javax.swing.JFrame;

import data_model.card;
import data_model.gambler;

public class test_frame extends JFrame {
  game_panel gp;
 
  public static void main(String[] args) throws IOException{
    new test_frame();
  }
 
  public test_frame() throws IOException{
    //field_model fm = new field_model();
    ArrayList<card> test_deck = new ArrayList<card>();


   
      //Daten zu Testzwecken vorbereiten (2 Spieler, 1 Kartendeck     
      test_deck.add(new card(0,1,1,1,7,1,100,"TestA","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,2,6,1,1,1,100,"TestB","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,3,1,1,5,1,100,"TestC","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,4,4,1,1,6,100,"TestD","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,5,1,3,3,1,100,"TestE","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,6,1,1,1,7,100,"TestF","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,7,1,4,1,1,100,"TestG","./src/img/TestKarte.png",true));
      test_deck.add(new card(0,8,1,3,9,4,100,"TestH","./src/img/TestKarte.png",true));
     
      gambler p1 = new gambler(1,"Spieler1",1000,1,test_deck,test_deck,Color.red);
      gambler p2 = new gambler(2,"Spieler2",1500,2,test_deck,test_deck,Color.blue);
     
     
    statics.setPlayer1(p1);
    statics.setPlayer2(p2);
   
    statics.setFm(new field_model());
   
    gp = new game_panel();
    gp.getMenu().setS1name(statics.getPlayer1().getName());
    gp.getMenu().setS2name(statics.getPlayer2().getName());
    gp.getMenu().setS1bc(statics.getFm().getCardcounter_p1()+"");
    gp.getMenu().setS2bc(statics.getFm().getCardcounter_p2()+"");
    this.setContentPane(gp);
    statics.getFm().setGp(gp);
   
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(statics.getWindow_width(),statics.getWindow_heigth());
        this.setVisible(true);
       
        statics.getFm().draw_beginner();
  }
}
TOP

Related Classes of view.test_frame

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.