Skip to content

Commit

Permalink
Fix showOrder for rectangular boards
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsPIRI committed Jan 29, 2020
1 parent 4976c7f commit 1c41da6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/thisispiri/mnk/andr/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import com.thisispiri.mnk.MnkGame;
import com.thisispiri.mnk.Shape;

/**Draws a rectangular board of {@link Shape}s on its area.*/
/**Draws a board of {@link Shape}s on its area.
* While the board may be rectangular in cells, the {@code View} itself must be square in pixels.*/
public class Board extends View {
public enum Symbol {
XS_AND_OS, GO_STONES
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/thisispiri/mnk/andr/DebugBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public void setAiInternals(String[][] internals) {
@Override public void setGame(MnkGame game) {
super.setGame(game);
for(Paint p : orderPaints) {
p.setTextSize(sideLength / horSize / 2);
p.setTextSize(sideLength / Math.max(horSize, verSize) / 2);
}
}
@Override public void setSideLength(int length) {
super.setSideLength(length);
for(Paint p : orderPaints) {
p.setTextSize(sideLength / horSize / 2);
p.setTextSize(sideLength / Math.max(horSize, verSize) / 2);
}
}
private int invertColor(@ColorInt int color) {
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<string name="app_name">피리 오목</string>
<string name="backgroundColor">바탕빛</string>
<string name="boardSize">판 크기</string>
<string name="changeSide">편 바꾸기</string>
<string name="changeSide">넘겨주기</string>
<string name="draw">무승부</string>
<string name="lineColor">줄 빛깔</string>
<string name="oColor">둘째 사람 빛깔</string>
Expand Down Expand Up @@ -33,8 +33,8 @@
<string name="locationRationale">블루투스 장치를 찾으려면 이 권한이 있어야 합니다.</string>
<string name="clientIdentifierHint">방제(상대와 같아야 함)</string>
<string name="serverIdentifierHint">방제(상대와 같아야 함)</string>
<string name="local">로컬</string>
<string name="bluetooth">블루투스</string>
<string name="local">한 대로</string>
<string name="bluetooth">두 대로</string>
<string name="requestRejected">요청이 거부되었습니다.</string>
<string name="requested">상대가 %s을(를) 요청했습니다.</string>
<string name="symbols">돌 모양</string>
Expand Down Expand Up @@ -71,9 +71,9 @@
<string name="myIndex">우리는</string>
<string name="tictactoe">틱택토</string>
<string name="go">바둑</string>
<string name="filler">Filler(너무 쉬움)</string>
<string name="filler">채우미(너무 쉬움)</string>
<string name="piriValue01">피리값 0.1(쉬움)</string>
<string name="piriValue">피리값 Value(가운데)</string>
<string name="piriValue">피리값(가운데)</string>
<string name="aiType">AI 종류</string>
<string name="emacsGomoku">에막스식(어려움)</string>
<string name="showAiInternals">AI의 생각 보이기</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<string name="settings">Settings</string>
<string name="restart">Restart</string>
<string name="draw">Draw</string>
<string name="changeSide">Change side</string>
<string name="changeSide">Yield</string>
<string name="boardSize">Board size</string>
<string name="backgroundColor">Background color</string>
<string name="lineColor">Line color</string>
Expand Down Expand Up @@ -76,7 +76,7 @@
<string name="aiType">AI type</string>
<string name="emacsGomoku">Emacs-style(hard)</string>
<string name="showAiInternals">Show AI internals</string>
<string name="emacsLengthWarning">Using Emacs-style with a winning length longer than 8 leads to crashes.</string>
<string name="emacsLengthWarning">Emacs-style cannot be used with a winning length longer than 8.</string>
<string name="gomoku1515">15x15 Gomoku</string>
<string name="gomoku1919">19x19 Gomoku</string>
<string name="restartRequest">Request a restart</string>
Expand Down

0 comments on commit 1c41da6

Please sign in to comment.