Last active
October 27, 2015 20:20
-
-
Save AnnaBoro/a0f9f343e179b545c699 to your computer and use it in GitHub Desktop.
lesson4-BattleField-Frame6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lesson4; | |
| /** | |
| * Created by anna on 27.10.15. | |
| */ | |
| public class BattleField { | |
| private int BF_WIDTH = 576; | |
| private int BF_HEIGHT = 576; | |
| private String[][] battleField = { | |
| {"B", " ", "B", "B", "B", "B", "B", "B", "B"}, | |
| {"B", " ", " ", " ", " ", " ", " ", " ", "B"}, | |
| {"B", "B", " ", " ", "B", " ", " ", "B", "B"}, | |
| {"B", " ", "B", " ", " ", " ", "B", " ", "B"}, | |
| {"B", " ", "B", " ", " ", " ", " ", " ", "B"}, | |
| {" ", " ", " ", "B", " ", "B", " ", "B", "B"}, | |
| {" ", "B", " ", " ", " ", " ", " ", "B", "B"}, | |
| {" ", " ", " ", "B", "B", "B", " ", " ", "B"}, | |
| {"B", " ", " ", "B", " ", " ", " ", " ", "B"}}; | |
| public BattleField() { | |
| } | |
| public int getBF_WIDTH() { | |
| return BF_WIDTH; | |
| } | |
| public int getBF_HEIGHT() { | |
| return BF_HEIGHT; | |
| } | |
| public String scanQuadrant(int v, int h) { | |
| return battleField[v][h]; | |
| } | |
| public void updateQuadrant(int v, int h, String str) { | |
| battleField[v][h] = str; | |
| } | |
| public int getDimensionX() { | |
| return battleField[0][0].length(); | |
| } | |
| public int getDimensionY() { | |
| return battleField[0].length; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment