package fishing;
public class State {
private String state_name;
private int enter_fee;
public State() {}
public State(String state_name, int enter_fee) {
this.state_name = state_name;
this.enter_fee = enter_fee;
}
public String getState_name() {
return state_name;
}
public void setState_name(String state_name) {
this.state_name = state_name;
}
public int getEnter_fee() {
return enter_fee;
}
public void setEnter_fee(int enter_fee) {
this.enter_fee = enter_fee;
}
}
package fishing;
import java.util.Scanner;
public class StateController {
private Scanner scan;
private StateService svc;
private boolean flag;
private String Spot;
public StateController(User u) {
scan = new Scanner(System.in);
svc = new StateServiceImpl();
flag = true;
choiceSpot(u);
}
private void choiceSpot(User u) {
System.out.println("----------------------------------Fishing spot choice----------------------------------");
System.out.println(
" .,,. \r\n"
+ " ,!$#!. \r\n"
+ " ;@@@;. \r\n"
+ " .!@@#; \r\n"
+ " ~#@@; .,,. \r\n"
+ " ,:;;;:, *@@!.-;***;:, \r\n"
+ " .;=@@@@@=!- .=@#-;$@@@@@#!, \r\n"
+ " --:=@@@@@$~-$@:*@@@@@*~-,. \r\n"
+ " ..~$@@@#;$@=@@@$~,. \r\n"
+ " .*@@#@@@@$~ ... \r\n"
+ " .-*$##$=#@@@@#$@@@@@#!, \r\n"
+ " -=@@@@@@@@@@@##@@@@@@@@#: \r\n"
+ " .$@@@#=*!=#@$$!~;!!*=$@@@#:. \r\n"
+ " ;@#=;~,,!#@=~!*, .,-:;!$$;. \r\n"
+ " $!~, .*@@#~ ;#! ,:!;!#= \r\n"
+ " .,. ;@@@!. -#:. .*#@#=$@! \r\n"
+ " #@@$, ;#: -=@@@@#.:$##*, \r\n"
+ " -#@@! =#* .,;#@@@=@@#$=;. \r\n"
+ " ~@@#, ~!;. ,;=$$#@@@@#*~, \r\n"
+ " ,#@$ ~#*- ,=@@#$$=@@@##$*~ \r\n"
+ " #@; ,**: .!=;:~--!;$@=*#@#~ \r\n"
+ " !@- ,$@=..-, -*,-@#;-!#$ \r\n"
+ " ,@. .;*!, .!!. *@=,.-*. \r\n"
+ " ~ .#$!, ,;~ -@@~ . \r\n"
+ " .#$!, .;=, ,@@~ \r\n"
+ " .;!$!---,,-;:. ,$$- \r\n"
+ " .:@@@@#@@#$$@$-. .*;. \r\n"
+ " ~=@@@@@@@@@@@@@@@@@#*, \r\n"
+ " ;@@@@@@@@@@@@@@@@@@@@@@@$~ \r\n"
+ " . ~;...!@#~ .-=@$,..~$@*...;=, \r\n"
+ " :@@;:@@@@$:;@@@@*:*@@@@!:#@@@#;:@@~ \r\n"
+ "");
while(flag) {
System.out.println(" ────────────────────────────────────────────────────────");
System.out.println(" │ │");
System.out.println(" │ 1. 물웅덩이 │ 2. 해변가 │");
System.out.println(" │ 입장조건: normal 이상 │ 입장조건: Standard 이상 │");
System.out.println(" │ 입장료: 무료 │ 입장료: 1000원 │");
System.out.println(" │ │");
System.out.println(" ────────────────────────────────────────────────────────");
System.out.println(" ────────────────────────────────────────────────────────");
System.out.println(" │ │");
System.out.println(" │ 3. 바다 │ 4. 깊은 바다 │");
System.out.println(" │ 입장조건: Premium 이상 │ 입장조건: Elite │");
System.out.println(" │ 입장료: 5000원 │ 입장료: 10000원 │");
System.out.println(" │ │");
System.out.println(" ────────────────────────────────────────────────────────");
System.out.println("번호를 입력해주세요.");
int menu = scan.nextInt();
State s = null;
switch(menu) {
// 각 case마다 FishingController 입력
case 1:
Spot = "A";
svc.calc(Spot, u.getNum());
s = svc.getSpot(Spot);
boatPrint();
System.out.println(s.getState_name()+"로 이동합니다.");
System.out.println("입장료 무료입니다.");
puddle();
flag = false;
new FishingController(u, s.getState_name(), u.getNum()); // 장소 이름과 유저의 num 전달
break;
case 2:
if(u.getMoney() < 1000) {
System.out.println("입장료를 지불할 돈이 없습니다... 돈을 버세욧!");
}else {
if(u.getFishrod().equals("Standard") || u.getFishrod().equals("Premium") || u.getFishrod().equals("Elite")) {
Spot = "B";
svc.calc(Spot, u.getNum());
s = svc.getSpot(Spot);
System.out.println(s.getState_name()+"로 이동합니다.");
CheckRod(Spot);
beach();
flag = false;
new FishingController(u, s.getState_name(), u.getNum()); // 장소 이름과 유저의 num 전달
}else {
System.out.println("낚시대 등급이 Standard 이상만 가능합니다.");
}
}
break;
case 3:
if(u.getMoney() < 5000) {
System.out.println("입장료를 지불할 돈이 없습니다... 돈을 버세욧!");
}else {
if(u.getFishrod().equals("Premium") || u.getFishrod().equals("Elite")) {
Spot = "C";
svc.calc(Spot, u.getNum());
s = svc.getSpot(Spot);
System.out.println(s.getState_name()+"로 이동합니다.");
CheckRod(Spot);
sea();
flag = false;
new FishingController(u, s.getState_name(), u.getNum()); // 장소 이름과 유저의 num 전달
}else {
System.out.println("낚시대 등급이 Premium 이상만 가능합니다.");
}
}
break;
case 4:
if(u.getMoney() < 10000) {
System.out.println("입장료를 지불할 돈이 없습니다... 돈을 버세욧!");
}else {
if(u.getFishrod().equals("Elite")) {
Spot = "D";
svc.calc(Spot, u.getNum());
s = svc.getSpot(Spot);
System.out.println(s.getState_name()+"로 이동합니다.");
CheckRod(Spot);
deep();
flag = false;
new FishingController(u, s.getState_name(), u.getNum()); // 장소 이름과 유저의 num 전달
}else {
System.out.println("낚시대 등급이 Elite만 가능합니다.");
}
}
break;
default : System.out.println("입력하신 번호는 없는 번호입니다");
}
}
}
public void CheckRod(String spot) {
State s = svc.getSpot(spot);
boatPrint();
System.out.println(s.getState_name()+"로 이동합니다.");
System.out.println("입장료 " + s.getEnter_fee() + "를 지불합니다.");
}
public void boatPrint() {
final int sleepTime = 600; // 밀리초 단위의 대기 시간
// 오른쪽으로 이동
try {
for(int i = 1; i <= 2; i++) {
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " ,, \r\n"
+ " ,$#;:== \r\n"
+ " -$*=$=#. \r\n"
+ " -$!!!$# \r\n"
+ " -$**==: \r\n"
+ " ~$=*;- \r\n"
+ " ,*;=~ \r\n"
+ " *;~=- \r\n"
+ " .-. ~=.:$- \r\n"
+ " :#*. .$,.;$- \r\n"
+ " -*=!. !; .;$- \r\n"
+ " :*:!!. -*. ,;$- \r\n"
+ " :*-~=!. .!~ ,!=- \r\n"
+ " ~=- :$!. ~!. ,!$: \r\n"
+ " .=- :$*. !~ .!#; \r\n"
+ " *~ .;$*. -!, .!#*. \r\n"
+ " -*. .!$=. :: .;$=. \r\n"
+ " !~ .*$$, ,!- .:$$, \r\n"
+ " -!, .*$$, -!. ~$#, \r\n"
+ " :: .!$#- ;: -=#- \r\n"
+ " ,;- .;$#- .*, ,*#; \r\n"
+ " -!. ;##~ -*. .!$* \r\n"
+ " ~; :#$; ;: :=# \r\n"
+ " .;~ ~$$* *- ,*#. \r\n"
+ " .!, ,*=$.$. .!#- \r\n"
+ " ,=-,.. ;=#;=.. ~=* \r\n"
+ " ~#*!!;;:~-:*#==!!;;:-,....!# \r\n"
+ " ;#$##$$$#==$$=*===##$$==***@!!!!**- \r\n"
+ " -$!!!!**=**=!************!!*!!!!!=; \r\n"
+ " .;=:::;;;;;;;:;;;;;;;;;;;;::;;;:;$. \r\n"
+ " -~..:~-=!;:;::::::;:::::::;:::::::::;$: .:- \r\n"
+ " :$$~$$*,*=;:!;:;;;:;!:;;;:;!;;;;;;!;;=$!,$$* \r\n"
+ " .**;;!$-~**=!~;:!!;:;!:!!;;;!;;;!;;~;=**-!!=-. \r\n"
+ " ,=!;=~#-*!*#*;;;;!;;-;;!!;;~;;;;!:!;$#!!;$-=~;:. \r\n"
+ " ,*:=*-*=;-!#~-=*-;;:,!;::;!,!!:-*=-~@=-!#:,*=;*- \r\n"
+ " .!;~---~-~~~,~~~-~~,;-~,-~---~-~~~,~~--~~,;~~-*- \r\n"
+ " ,===##*=#$*$#==#$=$$#=$#==##==#$=$#==#$==$$=$!. \r\n"
+ " --..~- ,~- -~.,~- ,~-.--.,~-.,~,.--.,~, ,~, \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
Thread.sleep(sleepTime); // 대기 시간
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " ,, \r\n"
+ " ,$#;:== \r\n"
+ " '' ' -$*=$=#. \r\n"
+ " ' ' '' -$!!!$# \r\n"
+ " ''''''' -$**==: \r\n"
+ " ~$=*;- \r\n"
+ " ,*;=~ \r\n"
+ " *;~=- \r\n"
+ " .-. ~=.:$- \r\n"
+ " :#*. .$,.;$- \r\n"
+ " -*=!. !; .;$- \r\n"
+ " :*:!!. -*. ,;$- \r\n"
+ " :*-~=!. .!~ ,!=- \r\n"
+ " ~=- :$!. ~!. ,!$: \r\n"
+ " .=- :$*. !~ .!#; \r\n"
+ " *~ .;$*. -!, .!#*. \r\n"
+ " -*. .!$=. :: .;$=. \r\n"
+ " !~ .*$$, ,!- .:$$, '' ' \r\n"
+ " -!, .*$$, -!. ~$#, ' ' '' \r\n"
+ " :: .!$#- ;: -=#- '''''' \r\n"
+ " ,;- .;$#- .*, ,*#; \r\n"
+ " -!. ;##~ -*. .!$* \r\n"
+ " ~; :#$; ;: :=# \r\n"
+ " .;~ ~$$* *- ,*#. \r\n"
+ " .!, ,*=$.$. .!#- \r\n"
+ " ,=-,.. ;=#;=.. ~=* \r\n"
+ " ~#*!!;;:~-:*#==!!;;:-,....!# \r\n"
+ " ;#$##$$$#==$$=*===##$$==***@!!!!**- \r\n"
+ " -$!!!!**=**=!************!!*!!!!!=; \r\n"
+ " .;=:::;;;;;;;:;;;;;;;;;;;;::;;;:;$. \r\n"
+ " -~..:~-=!;:;::::::;:::::::;:::::::::;$: .:- \r\n"
+ " :$$~$$*,*=;:!;:;;;:;!:;;;:;!;;;;;;!;;=$!,$$* \r\n"
+ " .**;;!$-~**=!~;:!!;:;!:!!;;;!;;;!;;~;=**-!!=-. \r\n"
+ " ,=!;=~#-*!*#*;;;;!;;-;;!!;;~;;;;!:!;$#!!;$-=~;:. \r\n"
+ " ,*:=*-*=;-!#~-=*-;;:,!;::;!,!!:-*=-~@=-!#:,*=;*- \r\n"
+ " .!;~---~-~~~,~~~-~~,;-~,-~---~-~~~,~~--~~,;~~-*- \r\n"
+ " ,===##*=#$*$#==#$=$$#=$#==##==#$=$#==#$==$$=$!. \r\n"
+ " --..~- ,~- -~.,~- ,~-.--.,~-.,~,.--.,~, ,~, \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
Thread.sleep(sleepTime); // 대기 시간
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " ,, \r\n"
+ " ,$#;:== \r\n"
+ " -$*=$=#. \r\n"
+ " -$!!!$# \r\n"
+ " -$**==: \r\n"
+ " ~$=*;- \r\n"
+ " ,*;=~ \r\n"
+ " *;~=- \r\n"
+ " .-. ~=.:$- \r\n"
+ " :#*. .$,.;$- \r\n"
+ " -*=!. !; .;$- \r\n"
+ " :*:!!. -*. ,;$- \r\n"
+ " :*-~=!. .!~ ,!=- \r\n"
+ " ~=- :$!. ~!. ,!$: \r\n"
+ " .=- :$*. !~ .!#; \r\n"
+ " *~ .;$*. -!, .!#*. \r\n"
+ " -*. .!$=. :: .;$=. \r\n"
+ " !~ .*$$, ,!- .:$$, \r\n"
+ " -!, .*$$, -!. ~$#, \r\n"
+ " :: .!$#- ;: -=#- \r\n"
+ " ,;- .;$#- .*, ,*#; \r\n"
+ " -!. ;##~ -*. .!$* \r\n"
+ " ~; :#$; ;: :=# \r\n"
+ " .;~ ~$$* *- ,*#. \r\n"
+ " .!, ,*=$.$. .!#- \r\n"
+ " ,=-,.. ;=#;=.. ~=* \r\n"
+ " ~#*!!;;:~-:*#==!!;;:-,....!# \r\n"
+ " ;#$##$$$#==$$=*===##$$==***@!!!!**- \r\n"
+ " -$!!!!**=**=!************!!*!!!!!=; \r\n"
+ " .;=:::;;;;;;;:;;;;;;;;;;;;::;;;:;$. \r\n"
+ " -~..:~-=!;:;::::::;:::::::;:::::::::;$: .:- \r\n"
+ " :$$~$$*,*=;:!;:;;;:;!:;;;:;!;;;;;;!;;=$!,$$* \r\n"
+ " .**;;!$-~**=!~;:!!;:;!:!!;;;!;;;!;;~;=**-!!=-. \r\n"
+ " ,=!;=~#-*!*#*;;;;!;;-;;!!;;~;;;;!:!;$#!!;$-=~;:. \r\n"
+ " ,*:=*-*=;-!#~-=*-;;:,!;::;!,!!:-*=-~@=-!#:,*=;*- \r\n"
+ " .!;~---~-~~~,~~~-~~,;-~,-~---~-~~~,~~--~~,;~~-*- \r\n"
+ " ,===##*=#$*$#==#$=$$#=$#==##==#$=$#==#$==$$=$!. \r\n"
+ " --..~- ,~- -~.,~- ,~-.--.,~-.,~,.--.,~, ,~, \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
Thread.sleep(sleepTime); // 대기 시간
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " \r\n"
+ " '' ' \r\n"
+ " ' ' '' \r\n"
+ " '''''''' \r\n"
+ " \r\n"
+ " ,, \r\n"
+ " ,$#;:== \r\n"
+ " -$*=$=#. \r\n"
+ " -$!!!$# \r\n"
+ " '' ' -$**==: \r\n"
+ " ' ' '' ~$=*;- \r\n"
+ " ''''''' ,*;=~ \r\n"
+ " *;~=- \r\n"
+ " .-. ~=.:$- \r\n"
+ " :#*. .$,.;$- \r\n"
+ " -*=!. !; .;$- \r\n"
+ " :*:!!. -*. ,;$- \r\n"
+ " :*-~=!. .!~ ,!=- \r\n"
+ " ~=- :$!. ~!. ,!$: '' ' \r\n"
+ " .=- :$*. !~ .!#; ' ' '' \r\n"
+ " *~ .;$*. -!, .!#*. ''''''' \r\n"
+ " -*. .!$=. :: .;$=. \r\n"
+ " !~ .*$$, ,!- .:$$, \r\n"
+ " -!, .*$$, -!. ~$#, \r\n"
+ " :: .!$#- ;: -=#- \r\n"
+ " ,;- .;$#- .*, ,*#; \r\n"
+ " -!. ;##~ -*. .!$* \r\n"
+ " ~; :#$; ;: :=# \r\n"
+ " .;~ ~$$* *- ,*#. \r\n"
+ " .!, ,*=$.$. .!#- \r\n"
+ " ,=-,.. ;=#;=.. ~=* \r\n"
+ " ~#*!!;;:~-:*#==!!;;:-,....!# \r\n"
+ " ;#$##$$$#==$$=*===##$$==***@!!!!**- \r\n"
+ " -$!!!!**=**=!************!!*!!!!!=; \r\n"
+ " .;=:::;;;;;;;:;;;;;;;;;;;;::;;;:;$. \r\n"
+ " -~..:~-=!;:;::::::;:::::::;:::::::::;$: .:- \r\n"
+ " :$$~$$*,*=;:!;:;;;:;!:;;;:;!;;;;;;!;;=$!,$$* \r\n"
+ " .**;;!$-~**=!~;:!!;:;!:!!;;;!;;;!;;~;=**-!!=-. \r\n"
+ " ,=!;=~#-*!*#*;;;;!;;-;;!!;;~;;;;!:!;$#!!;$-=~;:. \r\n"
+ " ,*:=*-*=;-!#~-=*-;;:,!;::;!,!!:-*=-~@=-!#:,*=;*- \r\n"
+ " .!;~---~-~~~,~~~-~~,;-~,-~---~-~~~,~~--~~,;~~-*- \r\n"
+ " ,===##*=#$*$#==#$=$$#=$#==##==#$=$#==#$==$$=$!. \r\n"
+ " --..~- ,~- -~.,~- ,~-.--.,~-.,~,.--.,~, ,~, \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
Thread.sleep(sleepTime); // 대기 시간
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " ,, \r\n"
+ " ,$#;:== \r\n"
+ " -$*=$=#. \r\n"
+ " -$!!!$# \r\n"
+ " -$**==: \r\n"
+ " ~$=*;- \r\n"
+ " ,*;=~ \r\n"
+ " *;~=- \r\n"
+ " .-. ~=.:$- \r\n"
+ " :#*. .$,.;$- \r\n"
+ " -*=!. !; .;$- \r\n"
+ " :*:!!. -*. ,;$- \r\n"
+ " :*-~=!. .!~ ,!=- \r\n"
+ " ~=- :$!. ~!. ,!$: \r\n"
+ " .=- :$*. !~ .!#; \r\n"
+ " *~ .;$*. -!, .!#*. \r\n"
+ " -*. .!$=. :: .;$=. \r\n"
+ " !~ .*$$, ,!- .:$$, \r\n"
+ " -!, .*$$, -!. ~$#, \r\n"
+ " :: .!$#- ;: -=#- \r\n"
+ " ,;- .;$#- .*, ,*#; \r\n"
+ " -!. ;##~ -*. .!$* \r\n"
+ " ~; :#$; ;: :=# \r\n"
+ " .;~ ~$$* *- ,*#. \r\n"
+ " .!, ,*=$.$. .!#- \r\n"
+ " ,=-,.. ;=#;=.. ~=* \r\n"
+ " ~#*!!;;:~-:*#==!!;;:-,....!# \r\n"
+ " ;#$##$$$#==$$=*===##$$==***@!!!!**- \r\n"
+ " -$!!!!**=**=!************!!*!!!!!=; \r\n"
+ " .;=:::;;;;;;;:;;;;;;;;;;;;::;;;:;$. \r\n"
+ " -~..:~-=!;:;::::::;:::::::;:::::::::;$: .:- \r\n"
+ " :$$~$$*,*=;:!;:;;;:;!:;;;:;!;;;;;;!;;=$!,$$* \r\n"
+ " .**;;!$-~**=!~;:!!;:;!:!!;;;!;;;!;;~;=**-!!=-. \r\n"
+ " ,=!;=~#-*!*#*;;;;!;;-;;!!;;~;;;;!:!;$#!!;$-=~;:. \r\n"
+ " ,*:=*-*=;-!#~-=*-;;:,!;::;!,!!:-*=-~@=-!#:,*=;*- \r\n"
+ " .!;~---~-~~~,~~~-~~,;-~,-~---~-~~~,~~--~~,;~~-*- \r\n"
+ " ,===##*=#$*$#==#$=$$#=$#==##==#$=$#==#$==$$=$!. \r\n"
+ " --..~- ,~- -~.,~- ,~-.--.,~-.,~,.--.,~, ,~, \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // 인터럽트 상태 복원
System.err.println("Thread was interrupted.");
}
}
public void beach() {
System.out.println(" \r\n"
+ " \r\n"
+ " \r\n"
+ " ..,. \r\n"
+ " .,-,. \r\n"
+ " .,--. \r\n"
+ " , ,--,. \r\n"
+ " --. ---, \r\n"
+ " ~~~, .--, ...\r\n"
+ " ~~~~,. ,--,.-~~\r\n"
+ " ~~~~~, .--,-~~-\r\n"
+ " ~~-~~-. . ,,,--~.\r\n"
+ " ,,-~~-. ... .,,-,---~-,,.\r\n"
+ " .~~~-- ....,..... .-~~~-~--:- \r\n"
+ " ,~~~~ ,,,,,,,,,,. .-~~~~,,,~:~;~ \r\n"
+ " -,.,-~~ ,,,,,,,,,,,,. ~~~~-..,, .-::;\r\n"
+ " -----~~,,,,,,,,,,,,,,,. .---. .,,, ~~;\r\n"
+ " --,---~,,,...........,,. --. ..,,. -~\r\n"
+ " -,,,--,,,..... ..... .,. .,,, ,\r\n"
+ " ...-~:-,,,,,,.. .,,, \r\n"
+ " ,:::--,..,,,,. .,,. \r\n"
+ " ,:;:-,--,.,,,,,. .... \r\n"
+ " .:;~- ---,.,,,,,. ., \r\n"
+ " -;;-. ,--, .,,,,,. .,. \r\n"
+ " !:~- ,--,. ,,,,,. - . \r\n"
+ " ~:~ .--,. .,,,,.. =~-,,,-, \r\n"
+ " ~~, .--, .,,,.. .,,:~, ,,-,-~ \r\n"
+ " ~;... ,,--... --,,,...........--, ,-. -----,....\r\n"
+ " :,....----,....-,,-..........:-, .---, ----~,...\r\n"
+ " :,....---.......-,-........ ~,, ,---, ----;...\r\n"
+ " ;.....--........,,,........:--- ,----, ----;...\r\n"
+ " ,.....-..........,-.......----. .----, -~:::...\r\n"
+ " ..........................~--, ,--~- ...~~,....\r\n"
+ " ..........................~---. -~::-...........\r\n"
+ " .... ..... ..........~--~~ .,-!:.. . \r\n"
+ " . ... .:::-. -;... .. \r\n"
+ " .. .. . . . .!. ... \r\n"
+ " .*. .\r\n"
+ " .,...,. ... ... ,... ..... ... .;~ .,,,..\r\n"
+ " ......... ........ .....,.~;... .... \r\n"
+ " ..-;... \r\n"
+ " . - ");
System.out.println();
}
public void deep() {
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " -. \r\n"
+ " ,:-; \r\n"
+ " .,:;=~ \r\n"
+ " ,,*!$#@ \r\n"
+ " ~.;;$$#@. . \r\n"
+ " ~:;#*$$#@=!!!!;:~:!: \r\n"
+ " ~:;@=@@@@@@@@@@$-.,-:*- \r\n"
+ " ##; ,!@@@@@@@@@@@@@@$ ,*, \r\n"
+ " @@@: $@, -#@@@@@@@@@@*-@@@@= :- \r\n"
+ " @@@@*@@@@@@@@@@@@@@@@,-#@@@@. $ \r\n"
+ " @@@@@@@@@@@@@@@@@@@@@@$@@@=@; *. \r\n"
+ " @@@@@@@@@@@@@@@@@@@@@@@@=$,$ ., \r\n"
+ " @@@@@@@@@@@@@@@@@@@@@@@=-~ - - \r\n"
+ " =@@@@$@@@@@@@@@@@@@@@@@@;-. ,. \r\n"
+ " @@@#~.#@@@@@@@@@@@@@@@#-~ = \r\n"
+ " .. ~;~@@@@@@@@@@@@@$ *@@ \r\n"
+ " -$@@@@@@@@@@@. . ,=, \r\n"
+ " -#@@@@@@@#$@ ,..; \r\n"
+ " ~#@@@@@@@;# .:,!!: \r\n"
+ " ~@@@@@@@@#!!*$*##$ \r\n"
+ " -@@@@@@@@@@@@@@@~ \r\n"
+ " ,#@@@@@@@@@@@@@ \r\n"
+ " ~@@@@@@@@@@@ \r\n"
+ " -*#####$~ \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
System.out.println();
}
public void sea() {
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " .~. \r\n"
+ " . .::. \r\n"
+ " ~, .:::. \r\n"
+ " :. .::::, \r\n"
+ " ::. ~::::-,,,,,,. \r\n"
+ " ~:~ ,:::::::::::::::::~ \r\n"
+ " -::. ,,-::::::::::::::~-::::::;: \r\n"
+ " ,::; ,::::::::::::::::::::::::::::~ \r\n"
+ " ,:::::::::::::::::::::::::~------------. \r\n"
+ " ,:::::::::::::::::::::::-............, \r\n"
+ " ,:::-:::::::::::::::::........ ... . \r\n"
+ " ,:: ,::::::::::::::........ \r\n"
+ " ,:. ,,,-::::::-.........,,. \r\n"
+ " .::::~-,............. \r\n"
+ " ,:::-, . . \r\n"
+ " -:~, \r\n"
+ " .. \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ " \r\n"
+ "");
}
public void puddle() {
System.out.println("\r\n"
+ "\r\n"
+ " \r\n"
+ " .. \r\n"
+ " . .. \r\n"
+ " . \r\n"
+ " .. \r\n"
+ " .. \r\n"
+ " ....,, \r\n"
+ " ... . . \r\n"
+ " . . \r\n"
+ " . . \r\n"
+ " . . - \r\n"
+ " . \r\n"
+ " . . \r\n"
+ " ., . . , \r\n"
+ " . . . .,. \r\n"
+ " .. . -. \r\n"
+ " . .. . . . . \r\n"
+ " ...., .,--. \r\n"
+ " ..., ,, .,,. \r\n"
+ " ., , ... \r\n"
+ " . ,. ., \r\n"
+ " . .. , .,. \r\n"
+ " . .. , . \r\n"
+ " . .. \r\n"
+ " . .. , \r\n"
+ " . .. . . .- \r\n"
+ " . ., . ..,- \r\n"
+ " . .. ..~ \r\n"
+ " . . . . .. ~ . \r\n"
+ " . . ... . , . \r\n"
+ " . . . . . - \r\n"
+ " .. . . , \r\n"
+ " , . .. - . \r\n"
+ " , .. ... , \r\n"
+ " . . . .., . \r\n"
+ " . . .. . .. . \r\n"
+ " . . . , \r\n"
+ " ., . . . \r\n"
+ " .,, .. . ... \r\n"
+ " . .- \r\n"
+ " . .. \r\n"
+ " .. ~ . \r\n"
+ " \r\n"
+ " \r\n"
+ "");
}
}
package fishing;
public interface StateService {
State getSpot(String spot);
void calc(String rod, int num);
}
package fishing;
public class StateServiceImpl implements StateService {
private StateDAO dao;
public StateServiceImpl() {
dao = new StateDAOImpl();
}
@Override
public State getSpot(String spot) {
return dao.printSpot(spot);
}
@Override
public void calc(String spot, int num) {
dao.getCalc(spot, num);
}
}
package fishing;
public interface StateDAO {
State printSpot(String spot);
void getCalc(String spot, int num);
}
package fishing;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class StateDAOImpl implements StateDAO {
private Connection conn;
private PreparedStatement pst;
private String query = "";
public StateDAOImpl() {
DatabaseConnection dbc = DatabaseConnection.getInstance();
conn = dbc.getConnection();
}
@Override
public State printSpot(String spot) {
query = "select state_name, enter_fee from state where state_id = ?;";
try {
pst = conn.prepareStatement(query);
pst.setString(1, spot);
ResultSet rs = pst.executeQuery();
if(rs.next()) {
State s = new State(rs.getString("state_name"), rs.getInt("enter_fee"));
return s;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
public void getCalc(String spot, int num) {
query = "update userlist u set u.money = u.money - (SELECT s.enter_fee FROM state s WHERE s.state_id = ?) WHERE u.num = ?;";
try {
pst = conn.prepareStatement(query);
pst.setString(1, spot);
pst.setInt(2, num);
pst.executeUpdate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
'자바 수업 정리' 카테고리의 다른 글
수업정리 18일차. (1) | 2024.10.16 |
---|---|
수업정리 17일차. (1) | 2024.10.15 |
수업정리 16일차. (3) | 2024.10.14 |
수업정리 15일차. (1) | 2024.10.11 |
수업정리 14일차. (0) | 2024.10.10 |