Advertisement
optimalcstrike

Untitled

May 11th, 2011
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. package com.cody.color;
  2.  
  3. import android.app.Activity;
  4. import android.widget.Button;
  5.  
  6.  
  7. public class GUIdriver extends Activity{
  8.  
  9. ButtonColorUpdate x0y0;
  10. ButtonColorUpdate x1y0;
  11. ButtonColorUpdate x2y0;
  12. ButtonColorUpdate x3y0;
  13. ButtonColorUpdate x4y0;
  14. ButtonColorUpdate x5y0;
  15. ButtonColorUpdate x0y1;
  16. ButtonColorUpdate x1y1;
  17. ButtonColorUpdate x2y1;
  18. ButtonColorUpdate x3y1;
  19. ButtonColorUpdate x4y1;
  20. ButtonColorUpdate x5y1;
  21. ButtonColorUpdate x0y2;
  22. ButtonColorUpdate x1y2;
  23. ButtonColorUpdate x2y2;
  24. ButtonColorUpdate x3y2;
  25. ButtonColorUpdate x4y2;
  26. ButtonColorUpdate x5y2;
  27. ButtonColorUpdate x0y3;
  28. ButtonColorUpdate x1y3;
  29. ButtonColorUpdate x2y3;
  30. ButtonColorUpdate x3y3;
  31. ButtonColorUpdate x4y3;
  32. ButtonColorUpdate x5y3;
  33. ButtonColorUpdate x0y4;
  34. ButtonColorUpdate x1y4;
  35. ButtonColorUpdate x2y4;
  36. ButtonColorUpdate x3y4;
  37. ButtonColorUpdate x4y4;
  38. ButtonColorUpdate x5y4;
  39. ButtonColorUpdate x0y5;
  40. ButtonColorUpdate x1y5;
  41. ButtonColorUpdate x2y5;
  42. ButtonColorUpdate x3y5;
  43. ButtonColorUpdate x4y5;
  44. ButtonColorUpdate x5y5;
  45. ColorFloodGame game = new ColorFloodGame (6,6);
  46. public GUIdriver (ColorFloodGame g1){
  47. game = g1;
  48. }
  49.  
  50. public void initialize(){
  51. x0y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y0), 0, 0);
  52. x1y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y0), 1, 0);
  53. x2y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y0), 2, 0);
  54. x3y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y0), 3, 0);
  55. x4y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y0), 4, 0);
  56. x5y0 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y0), 5, 0);
  57. x0y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y0), 0, 0);
  58. x1y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y1), 1, 1);
  59. x2y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y1), 2, 1);
  60. x3y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y1), 3, 1);
  61. x4y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y1), 4, 1);
  62. x5y1 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y1), 5, 1);
  63. x0y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y2), 0, 2);
  64. x1y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y2), 1, 2);
  65. x2y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y2), 2, 2);
  66. x3y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y2), 3, 2);
  67. x4y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y2), 4, 2);
  68. x5y2 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y2), 5, 2);
  69. x0y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y3), 0, 3);
  70. x1y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y3), 1, 3);
  71. x2y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y3), 2, 3);
  72. x3y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y3), 3, 3);
  73. x4y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y3), 4, 3);
  74. x5y3 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y3), 5, 3);
  75. x0y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y4), 0, 4);
  76. x1y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y4), 1, 4);
  77. x2y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y4), 2, 4);
  78. x3y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y4), 3, 4);
  79. x4y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y4), 4, 4);
  80. x5y4 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y4), 5, 4);
  81. x0y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x0y5), 0, 5);
  82. x1y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x1y5), 1, 5);
  83. x2y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x2y5), 2, 5);
  84. x3y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x3y5), 3, 5);
  85. x4y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x4y5), 4, 5);
  86. x5y5 = new ButtonColorUpdate(game, (Button)findViewById(R.id.x5y5), 5, 5);
  87. }
  88. public void UIupdate() {
  89. x0y0.updateVal();
  90. x1y0.updateVal();
  91. x2y0.updateVal();
  92. x3y0.updateVal();
  93. x4y0.updateVal();
  94. x5y0.updateVal();
  95. x0y1.updateVal();
  96. x1y1.updateVal();
  97. x2y1.updateVal();
  98. x3y1.updateVal();
  99. x4y1.updateVal();
  100. x5y1.updateVal();
  101. x0y2.updateVal();
  102. x1y2.updateVal();
  103. x2y2.updateVal();
  104. x3y2.updateVal();
  105. x4y2.updateVal();
  106. x5y2.updateVal();
  107. x0y3.updateVal();
  108. x1y3.updateVal();
  109. x2y3.updateVal();
  110. x3y3.updateVal();
  111. x4y3.updateVal();
  112. x5y3.updateVal();
  113. x0y4.updateVal();
  114. x1y4.updateVal();
  115. x2y4.updateVal();
  116. x3y4.updateVal();
  117. x4y4.updateVal();
  118. x5y4.updateVal();
  119. x0y5.updateVal();
  120. x1y5.updateVal();
  121. x2y5.updateVal();
  122. x3y5.updateVal();
  123. x4y5.updateVal();
  124. x5y5.updateVal();
  125.  
  126. }
  127.  
  128. public void updateColors() {
  129. x0y0.change();
  130. x1y0.change();
  131. x2y0.change();
  132. x3y0.change();
  133. x4y0.change();
  134. x5y0.change();
  135. x0y1.change();
  136. x1y1.change();
  137. x2y1.change();
  138. x3y1.change();
  139. x4y1.change();
  140. x5y1.change();
  141. x0y2.change();
  142. x1y2.change();
  143. x2y2.change();
  144. x3y2.change();
  145. x4y2.change();
  146. x5y2.change();
  147. x0y3.change();
  148. x1y3.change();
  149. x2y3.change();
  150. x3y3.change();
  151. x4y3.change();
  152. x5y3.change();
  153. x0y4.change();
  154. x1y4.change();
  155. x2y4.change();
  156. x3y4.change();
  157. x4y4.change();
  158. x5y4.change();
  159. x0y5.change();
  160. x1y5.change();
  161. x2y5.change();
  162. x3y5.change();
  163. x4y5.change();
  164. x5y5.change();
  165. }
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement