본문 바로가기
개발 (Game)/(2021) Unity RTS 포트폴리오

[Day 12-2] 정치 사상 구현 + 인구 클래스 뼈대 구현

by 진현개발일기 2021. 7. 23.

[2021. 07. 23]

 

 

먼저 Measure 클래스의 생성자 부분을 바꿔줬다. 리스트에 현재 제도의 상태들을 다 담아놓고 플레이어가 국가를 선택했을 때, 법을 수정할 때 진보 쪽인지 보수 쪽인지 확인 시키고 싶기 때문이다.

 

There have been some changes taken place. In order to show which Politic thoughts Player's Nation leaning on, had to come up with a 'List<bool>' that contains current laws' status.

Return Function in Measure Class

플레이어 스텟에 Conservative 라는 int 변수를 만들었고 보수 성격을 띄우는 bool이 몇 개가 있는지 검사한다.

Ive made an integer variable so I can count how many bools are Conservative-related.

처음에 플레이어가 나라를 선택했을 때 LawRevise 함수로 들어간다.
3, 6번째 인덱스의 값은 true이면 보수쪽, 나머지는 false이면 보수쪽이다.

위에 bool 변수들을 판별하여 법이 보수쪽인지 진보쪽인지 판별한다.

LawRevise() func plays a role of figuring out if the nation has progressive thoughts or conservative one.

 

처음 생성 했을 때 뿐만이 아니라 법을 개정 했을 때도 확인한다.
인도 (성공) India (successfully worked)
한국(성공) Korea(same here)

 

 

진보, 보수 성향은 실제 '슈퍼파워 2' 게임의 자료를 참고하였다.

 

 

 

인구 감소률을 추가하기 위해 의료비를 추가하였다. 국방비랑 묶어놓은 이유는 예산이 부족하면 장비가 부실할 것이고 그에 따른 희생이 따르기 때문이다.

 

To make this game more complex, Ive added a treasury variable for Medical System as well. 

 

the underlined treausry take charges in Population Decline Rate. Low-treasury of the field will bring about a decrease in population. 

 

 

▼ 인구 클라스(Population Class)

최대 값을 상수 값으로 지정하였다.

const variables as maximum values.

 

 

매 턴이 지날 때 마다 인구가 조절된다.

Population get changed every each of turn.

 

성공하였다. 이제 경제 클래스를 만들고 그 뒤에는 서로 영향을 받게 해야겠다.

Gottcha. but i need to be in hurry 'cause im way behind on other optipns ( economy + interactions ) 

728x90