Commit a63474e2 authored by redsuncore's avatar redsuncore

Factory Name Parsing(WIP)

생산 이름 파싱 중
parent 0704cdff
fileFormatVersion: 2
guid: 06d1e9b94983c2b43b353b6afc3e4574
timeCreated: 1520012438
timeCreated: 1520020079
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 14316eefeff7b8c4882dee9cb31df5f1
timeCreated: 1520012438
timeCreated: 1520020079
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 52d4b4bcbfe43994e999b8f5be390d82
timeCreated: 1520012438
timeCreated: 1520023678
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 43a349a478a56d34f81309845b5fd7ca
timeCreated: 1520012438
timeCreated: 1520023678
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 9cd8c45234b33194ab238aa2797329af
timeCreated: 1520012438
timeCreated: 1520024484
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: f800f112e738c91408b1c549735a7597
timeCreated: 1520012438
timeCreated: 1520020079
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 51a4ccfc53e3bd3489fedcd4adb9e458
timeCreated: 1520012438
timeCreated: 1520020079
licenseType: Free
DefaultImporter:
externalObjects: {}
......
......@@ -6,6 +6,7 @@ using UnityEngine;
using UnityEngine.EventSystems;
using CivModel;
using CivModel.Common;
using System.Threading.Tasks;
public class GameManager : MonoBehaviour {
private static GameManager _manager = null;
......@@ -59,7 +60,15 @@ public class GameManager : MonoBehaviour {
// Use this when scene changing exists
// DontDestroyOnLoad(gameObject);
//_game = new CivModel.Game(GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer, new GameSchemeFactory()/*, new IGameSchemeFactory[] { new CivModel.AI.GameSchemeFactory()}*/);
_game = new CivModel.Game(".\\Assets\\map.txt", new IGameSchemeFactory[] { new CivModel.Common.GameSchemeFactory() });
var factories = new IGameSchemeFactory[] {
new CivModel.Common.GameSchemeFactory(),
new CivModel.Hwan.GameSchemeFactory(),
new CivModel.Finno.GameSchemeFactory(),
new CivModel.Quests.GameSchemeFactory(),
new CivModel.Zap.GameSchemeFactory(),
new CivModel.AI.GameSchemeFactory()
};
_game = new CivModel.Game(".\\Assets\\map.txt", factories);
_game.StartTurn();
}
......@@ -71,15 +80,16 @@ public class GameManager : MonoBehaviour {
ObserverSet();
DrawMap();
_game.Players[1].IsAIControlled = true;
ProceedTurn();
UIManager.I.MakeUnitInfo();
}
// Update is called once per frame
void Update() {
Render(_game.Terrain);
Debug.Log(Game.PlayerNumberInTurn);
//Debug.Log("Gold:" + _game.PlayerInTurn.Gold + "(+" + _game.PlayerInTurn.GoldIncome +")");
//Debug.Log("Pop:" + _game.PlayerInTurn.Population);
//Debug.Log("Happ:" + _game.PlayerInTurn.Happiness);
......@@ -272,23 +282,35 @@ public class GameManager : MonoBehaviour {
isThereTodos = true;
Focus();
}
public void ProceedTurn()
public async Task ProceedTurn()
{
if (_game.IsInsideTurn)
_game.EndTurn();
_game.StartTurn();
SelectNextUnit();
if (_selectedActor == null)
while (true)
{
if (_game.PlayerInTurn.Cities.FirstOrDefault() is CivModel.CityBase)
if (_game.IsInsideTurn)
_game.EndTurn();
_game.StartTurn();
if (_game.PlayerInTurn.IsAIControlled)
{
CityBase city = _game.PlayerInTurn.Cities.FirstOrDefault();
if (city.PlacedPoint is CivModel.Terrain.Point)
Focus(city.PlacedPoint.Value);
await _game.PlayerInTurn.DoAITurnAction();
}
else
{
SelectNextUnit();
if (_selectedActor == null)
{
if (_game.PlayerInTurn.Cities.FirstOrDefault() is CivModel.CityBase)
{
CityBase city = _game.PlayerInTurn.Cities.FirstOrDefault();
if (city.PlacedPoint is CivModel.Terrain.Point)
Focus(city.PlacedPoint.Value);
}
}
PseudoFSM.I.NormalStateEnter();
UIManager.I.MakeUnitInfo();
break;
}
}
PseudoFSM.I.NormalStateEnter();
}
// Camera focus
......@@ -390,11 +412,104 @@ public static class ProductionFactoryTraits
case "JediKnightProductionFactory":
result = "제다이 기사";
break;
case "FakeKnightProductionFactory":
result = "가짜 기사(테스팅)";
break;
case "BrainwashedEMUKnightProductionFactory":
result = "세뇌된 에뮤 기사";
break;
case "DecentralizedMilitaryProductionFactory":
result = "탈중앙화된 군인";
break;
case "JackieChanProductionFactory":
result = "재키 찬";
break;
case "LEOSpaceArmadaProductionFactory":
result = "저궤도 우주 함대";
break;
case "ProtoNinjaProductionFactory":
result = "프로토-닌자";
break;
case "UnicornOrderProductionFactory":
result = "유니콘 기사단";
break;
case "SpyProductionFactory":
result = "스파이";
break;
case "AncientSorcererProductionFactory":
result = "고대 소서러";
break;
case "AutismBeamDroneFactory":
result = "O-ti-ism 빔 드론";
break;
case "ElephantCavalryProductionFactory":
result = "코끼리 기병";
break;
case "EMUHorseArcherProductionFactory":
result = "에뮤 궁기병";
break;
case "GenghisKhanProductionFactory":
result = "징기즈 칸";
break;
case "ArmedDivisionProductionFactory":
result = "기갑사단";
break;
case "InfantryDivisionProductionFactory":
result = "보병사단";
break;
case "PadawanProductionFactory":
result = "파다완";
break;
case "ZapNinjaProductionFactory":
result = "닌자";
break;
case "CityCenterProductionFactory":
result = "도심부";
break;
case "FakeKnightProductionFactory":
result = "가짜 기사(테스팅)";
case "HwanEmpireCityProductionFactory":
result = "환 제국 도시";
break;
case "HwanEmpireFIRFortressProductionFactory":
result = "환 제국 4차 산업 요새";
break;
case "HwanEmpireCityCentralLabProductionFactory":
result = "환 제국 도시 연구소";
break;
case "HwanEmpireFIRFactoryProductionFactory":
result = "환 제국 4차 산업 요새";
break;
case "HwanEmpireIbizaProductionFactory":
result = "환 제국 이비자";
break;
case "HwanEmpireKimchiFactoryProductionFactory":
result = "환 제국 김치 군수공장";
break;
case "HwanEmpireLatifundiumProductionFactory":
result = "환 제국 라티푼디움";
break;
case "AncientFinnoFineDustFactoryProductionFactory":
result = "고대 수오미 제국 미세먼지 공장";
break;
case "AncientFinnoFIRFortressProductionFactory":
result = "고대 수오미 제국 4차 산업 요새";
break;
case "AncientFinnoGermaniumMineProductionFactory":
result = "고대 수오미 제국 게르마늄 광산";
break;
case "AncientFinnoOctagonProductionFactory":
result = "고대 수오미 제국 옥타곤";
break;
case "FinnoEmpireCityProductionFactory":
result = "고대 수오미 제국 도시";
break;
case "CasinoProductionFactory":
result = "카지노";
break;
case "FIRFortressProductionFactory":
result = "4차 산업 요새";
break;
case "ZapFactoryBuildingProductionFactory":
result = "공장";
break;
case "FactoryBuildingProductionFactory":
result = "공장";
......@@ -433,6 +548,54 @@ public static class ProductionFactoryTraits
case "LaboratoryBuildingProductionFactory":
result = "Laboratory";
break;
case "BrainwashedEMUKnightProductionFactory":
result = "BrainwashedEMUKnight";
break;
case "DecentralizedMilitaryProductionFactory":
result = "DecentralizedMilitary";
break;
case "JackieChanProductionFactory":
result = "JackieChan";
break;
case "LEOSpaceArmadaProductionFactory":
result = "LEOSpaceArmada";
break;
case "ProtoNinjaProductionFactory":
result = "ProtoNinja";
break;
case "UnicornOrderProductionFactory":
result = "UnicornOrder";
break;
case "SpyProductionFactory":
result = "Spy";
break;
case "AncientSorcererProductionFactory":
result = "AncientSorcerer";
break;
case "AutismBeamDroneFactory":
result = "AutismBeamDrone";
break;
case "ElephantCavalryProductionFactory":
result = "ElephantCavalry";
break;
case "EMUHorseArcherProductionFactory":
result = "EMUHorseArcher";
break;
case "GenghisKhanProductionFactory":
result = "GenghisKhan";
break;
case "ArmedDivisionProductionFactory":
result = "ArmedDivision";
break;
case "InfantryDivisionProductionFactory":
result = "InfantryDivision";
break;
case "PadawanProductionFactory":
result = "Padawan";
break;
case "ZapNinjaProductionFactory":
result = "ZapNinja";
break;
default:
result = "unknown : " + name;
break;
......@@ -461,9 +624,57 @@ public static class ProductionFactoryTraits
case "FactoryBuilding":
result = "공장";
break;
case "LabortoryBuilding":
case "LaboratoryBuilding":
result = "연구소";
break;
case "BrainwashedEMUKnight":
result = "세뇌된 에뮤 기사";
break;
case "DecentralizedMilitary":
result = "탈중앙화된 군인";
break;
case "JackieChan":
result = "재키 찬";
break;
case "LEOSpaceArmada":
result = "저궤도 우주 함대";
break;
case "ProtoNinja":
result = "프로토-닌자";
break;
case "UnicornOrder":
result = "유니콘 기사단";
break;
case "Spy":
result = "스파이";
break;
case "AncientSorcerer":
result = "고대 소서러";
break;
case "AutismBeamDrone":
result = "O-ti-ism 빔 드론";
break;
case "ElephantCavalry":
result = "코끼리 기병";
break;
case "EMUHorseArcher":
result = "에뮤 궁기병";
break;
case "GenghisKhan":
result = "징기즈 칸";
break;
case "ArmedDivision":
result = "기갑사단";
break;
case "InfantryDivision":
result = "보병사단";
break;
case "Padawan":
result = "파다완";
break;
case "ZapNinja":
result = "닌자";
break;
default:
result = "unknown : " + name;
break;
......
......@@ -71,7 +71,7 @@ public class HexTile : MonoBehaviour
if (building is CivModel.CityBase)
{
Debug.Log(building.Owner.Team);
//Debug.Log(building.Owner.Team);
buildings.GetChild(2).gameObject.SetActive(true);
side = buildings.GetChild((building.Owner.Team + 1) % 2);
side.GetChild(0).gameObject.SetActive(true);
......
......@@ -149,7 +149,8 @@ public class ManagementUIController : MonoBehaviour {
}
else if(typeof(TileObject).IsAssignableFrom(fac.ResultType))
{
if(typeof(CityBase).IsAssignableFrom(fac.ResultType))
Debug.Log(fac.ToString());
if (typeof(CityBase).IsAssignableFrom(fac.ResultType))
{
PartSelectionQ(CityQlist, CityQueue, fac);
}
......
......@@ -73,27 +73,36 @@ public class UIManager : MonoBehaviour {
}
void Update()
{
if (GameManager.I.isThereTodos && !PseudoFSM.I.DepState)
if (GameManager.I.Game.PlayerInTurn.IsAIControlled)
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "유닛이 명령을 기다리고 있습니다";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Button>().enabled = false;
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다른 플레이어가 턴 진행 중입니다. 기다려 주십시오.";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 40;
}
else if (PseudoFSM.I.DepState)
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "배치 취소";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 25;
}
else
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다음 턴";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 25;
MapUI.transform.Find("EndTurn").GetComponentInChildren<Button>().enabled = true;
if (GameManager.I.isThereTodos && !PseudoFSM.I.DepState)
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "유닛이 명령을 기다리고 있습니다";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 40;
}
else if (PseudoFSM.I.DepState)
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "배치 취소";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 25;
}
else
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다음 턴";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 25;
}
Gold.text = "금 : " + GameManager.I.Game.PlayerInTurn.Gold + "(+" + GameManager.I.Game.PlayerInTurn.GoldIncome + ")";
Population.text = "인구 : " + GameManager.I.Game.PlayerInTurn.Population;
Happiness.text = "행복 : " + GameManager.I.Game.PlayerInTurn.Happiness;
Technology.text = "기술력 : " + GameManager.I.Game.PlayerInTurn.Research;
Labor.text = "노동력 : " + GameManager.I.Game.PlayerInTurn.Labor;
}
Gold.text = "금 : " + GameManager.I.Game.PlayerInTurn.Gold + "(+" + GameManager.I.Game.PlayerInTurn.GoldIncome + ")";
Population.text = "인구 : " + GameManager.I.Game.PlayerInTurn.Population;
Happiness.text = "행복 : " + GameManager.I.Game.PlayerInTurn.Happiness;
Technology.text = "기술력 : " + GameManager.I.Game.PlayerInTurn.Research;
Labor.text = "노동력 : " + GameManager.I.Game.PlayerInTurn.Labor;
}
public void MakeUnitInfo()
{
......@@ -265,7 +274,6 @@ public class UIManager : MonoBehaviour {
else
{
GameManager.I.ProceedTurn();
MakeUnitInfo();
}
}
......@@ -378,4 +386,10 @@ public class UIManager : MonoBehaviour {
CityBuildingTab.SetActive(false);
NormalBuildingTab.SetActive(true);
}
public void WaitTurn()
{
MapUI.SetActive(true);
ManagementUI.SetActive(false);
QuestUI.SetActive(false);
}
}
Subproject commit 81ffd2d0ad01bfff8538d8a8790207035689ef5b
Subproject commit f57823866e8f7427a7c2434466af713c10ca4ed2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment