Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cody.color;
- import android.app.Activity;
- import android.widget.Button;
- public class GUIdriver extends Activity{
- ButtonColorUpdate x0y0;
- ButtonColorUpdate x1y0;
- ButtonColorUpdate x2y0;
- ButtonColorUpdate x3y0;
- ButtonColorUpdate x4y0;
- ButtonColorUpdate x5y0;
- ButtonColorUpdate x0y1;
- ButtonColorUpdate x1y1;
- ButtonColorUpdate x2y1;
- ButtonColorUpdate x3y1;
- ButtonColorUpdate x4y1;
- ButtonColorUpdate x5y1;
- ButtonColorUpdate x0y2;
- ButtonColorUpdate x1y2;
- ButtonColorUpdate x2y2;
- ButtonColorUpdate x3y2;
- ButtonColorUpdate x4y2;
- ButtonColorUpdate x5y2;
- ButtonColorUpdate x0y3;
- ButtonColorUpdate x1y3;
- ButtonColorUpdate x2y3;
- ButtonColorUpdate x3y3;
- ButtonColorUpdate x4y3;
- ButtonColorUpdate x5y3;
- ButtonColorUpdate x0y4;
- ButtonColorUpdate x1y4;
- ButtonColorUpdate x2y4;
- ButtonColorUpdate x3y4;
- ButtonColorUpdate x4y4;
- ButtonColorUpdate x5y4;
- ButtonColorUpdate x0y5;
- ButtonColorUpdate x1y5;
- ButtonColorUpdate x2y5;
- ButtonColorUpdate x3y5;
- ButtonColorUpdate x4y5;
- ButtonColorUpdate x5y5;
- ColorFloodGame game = new ColorFloodGame (6,6);
- public GUIdriver (ColorFloodGame g1){
- game = g1;
- }
- public void initialize(){
- x0y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y0), 0, 0);
- x1y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y0), 1, 0);
- x2y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y0), 2, 0);
- x3y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y0), 3, 0);
- x4y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y0), 4, 0);
- x5y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y0), 5, 0);
- x0y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y0), 0, 0);
- x1y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y1), 1, 1);
- x2y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y1), 2, 1);
- x3y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y1), 3, 1);
- x4y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y1), 4, 1);
- x5y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y1), 5, 1);
- x0y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y2), 0, 2);
- x1y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y2), 1, 2);
- x2y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y2), 2, 2);
- x3y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y2), 3, 2);
- x4y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y2), 4, 2);
- x5y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y2), 5, 2);
- x0y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y3), 0, 3);
- x1y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y3), 1, 3);
- x2y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y3), 2, 3);
- x3y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y3), 3, 3);
- x4y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y3), 4, 3);
- x5y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y3), 5, 3);
- x0y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y4), 0, 4);
- x1y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y4), 1, 4);
- x2y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y4), 2, 4);
- x3y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y4), 3, 4);
- x4y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y4), 4, 4);
- x5y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y4), 5, 4);
- x0y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y5), 0, 5);
- x1y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y5), 1, 5);
- x2y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y5), 2, 5);
- x3y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y5), 3, 5);
- x4y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y5), 4, 5);
- x5y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y5), 5, 5);
- }
- public void UIupdate() {
- x0y0.updateVal();
- x1y0.updateVal();
- x2y0.updateVal();
- x3y0.updateVal();
- x4y0.updateVal();
- x5y0.updateVal();
- x0y1.updateVal();
- x1y1.updateVal();
- x2y1.updateVal();
- x3y1.updateVal();
- x4y1.updateVal();
- x5y1.updateVal();
- x0y2.updateVal();
- x1y2.updateVal();
- x2y2.updateVal();
- x3y2.updateVal();
- x4y2.updateVal();
- x5y2.updateVal();
- x0y3.updateVal();
- x1y3.updateVal();
- x2y3.updateVal();
- x3y3.updateVal();
- x4y3.updateVal();
- x5y3.updateVal();
- x0y4.updateVal();
- x1y4.updateVal();
- x2y4.updateVal();
- x3y4.updateVal();
- x4y4.updateVal();
- x5y4.updateVal();
- x0y5.updateVal();
- x1y5.updateVal();
- x2y5.updateVal();
- x3y5.updateVal();
- x4y5.updateVal();
- x5y5.updateVal();
- }
- public void updateColors() {
- x0y0.change();
- x1y0.change();
- x2y0.change();
- x3y0.change();
- x4y0.change();
- x5y0.change();
- x0y1.change();
- x1y1.change();
- x2y1.change();
- x3y1.change();
- x4y1.change();
- x5y1.change();
- x0y2.change();
- x1y2.change();
- x2y2.change();
- x3y2.change();
- x4y2.change();
- x5y2.change();
- x0y3.change();
- x1y3.change();
- x2y3.change();
- x3y3.change();
- x4y3.change();
- x5y3.change();
- x0y4.change();
- x1y4.change();
- x2y4.change();
- x3y4.change();
- x4y4.change();
- x5y4.change();
- x0y5.change();
- x1y5.change();
- x2y5.change();
- x3y5.change();
- x4y5.change();
- x5y5.change();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement