Commit d4e36d8d authored by redsuncore's avatar redsuncore

Production Queue Button Activated, Deploying Bug fixed

생산 큐 삭제, Priority 변경 가능.
배치할 때 배치 큐에서 유닛 사라지지 않아 게속 배치할 수 있던 문제 해결.
parent 864c39d6
...@@ -310,6 +310,7 @@ public class GameManager : MonoBehaviour { ...@@ -310,6 +310,7 @@ public class GameManager : MonoBehaviour {
void Deploy(CivModel.Terrain.Point point, Production dep) void Deploy(CivModel.Terrain.Point point, Production dep)
{ {
dep.Place(point); dep.Place(point);
Game.PlayerInTurn.Deployment.Remove(dep);
PseudoFSM.I.NormalStateEnter(); PseudoFSM.I.NormalStateEnter();
} }
} }
......
...@@ -49,6 +49,7 @@ public class ManagementUIController : MonoBehaviour { ...@@ -49,6 +49,7 @@ public class ManagementUIController : MonoBehaviour {
{ {
if(fac.ProductionResultType != null) if(fac.ProductionResultType != null)
{ {
fac.ProductionResultType.GetInterface("battleclasslevel");
PartSelectionQ(EpicQlist, EpicQueue, fac); PartSelectionQ(EpicQlist, EpicQueue, fac);
} }
} }
...@@ -85,7 +86,6 @@ public class ManagementUIController : MonoBehaviour { ...@@ -85,7 +86,6 @@ public class ManagementUIController : MonoBehaviour {
productableQueue = null; productableQueue = null;
Debug.Log("Error : qlist = " + qlist); Debug.Log("Error : qlist = " + qlist);
throw new MissingComponentException(); throw new MissingComponentException();
break;
} }
Debug.Log("SelectionList : " + ASQlist.IndexOf(qlist) + "null"); Debug.Log("SelectionList : " + ASQlist.IndexOf(qlist) + "null");
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity); var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
...@@ -96,6 +96,11 @@ public class ManagementUIController : MonoBehaviour { ...@@ -96,6 +96,11 @@ public class ManagementUIController : MonoBehaviour {
qlist.Add(SPrefab); qlist.Add(SPrefab);
} }
} }
foreach (GameObject sq in EpicQlist)
{
sq.GetComponent<SelPrefab>().SetButton(EpicQlist.IndexOf(sq));
Debug.Log(EpicQlist.IndexOf(sq));
}
} }
//각 Factory의 분야를 읽어서 해당하는 Queue에 집어넣는 역할 //각 Factory의 분야를 읽어서 해당하는 Queue에 집어넣는 역할
private GameObject PartSelectionQ(List<GameObject> SQlist, GameObject productableQueue, IProductionFactory fac) private GameObject PartSelectionQ(List<GameObject> SQlist, GameObject productableQueue, IProductionFactory fac)
...@@ -147,11 +152,6 @@ public class ManagementUIController : MonoBehaviour { ...@@ -147,11 +152,6 @@ public class ManagementUIController : MonoBehaviour {
MakeSelectionQ(); MakeSelectionQ();
MakeProductionQ(); MakeProductionQ();
MakeDeploymentQ(); MakeDeploymentQ();
foreach (GameObject sq in EpicQlist)
{
sq.GetComponent<SelPrefab>().SetButton(EpicQlist.IndexOf(sq));
Debug.Log(EpicQlist.IndexOf(sq));
}
foreach (GameObject dq in DQlist) foreach (GameObject dq in DQlist)
{ {
dq.GetComponent<DepPrefab>().SetButton(DQlist.IndexOf(dq)); dq.GetComponent<DepPrefab>().SetButton(DQlist.IndexOf(dq));
...@@ -233,7 +233,10 @@ public class ManagementUIController : MonoBehaviour { ...@@ -233,7 +233,10 @@ public class ManagementUIController : MonoBehaviour {
tempList.Add(PPrefab); tempList.Add(PPrefab);
} }
PQlist = tempList; PQlist = tempList;
foreach (GameObject pq in PQlist)
{
pq.GetComponent<ProPrefab>().SetButton(PQlist.IndexOf(pq));
}
} }
public void MakeDeploymentQ() public void MakeDeploymentQ()
...@@ -267,6 +270,10 @@ public class ManagementUIController : MonoBehaviour { ...@@ -267,6 +270,10 @@ public class ManagementUIController : MonoBehaviour {
tempList.Add(DPrefab); tempList.Add(DPrefab);
} }
DQlist = tempList; DQlist = tempList;
foreach (GameObject dq in DQlist)
{
dq.GetComponent<DepPrefab>().SetButton(DQlist.IndexOf(dq));
}
} }
public static ManagementUIController GetManagementUIController() public static ManagementUIController GetManagementUIController()
{ {
......
...@@ -8,9 +8,12 @@ using CivModel.Common; ...@@ -8,9 +8,12 @@ using CivModel.Common;
public class DepPrefab : MonoBehaviour { public class DepPrefab : MonoBehaviour {
public static GameObject DeployingObject;
private Text[] textarguments; private Text[] textarguments;
private Image unitPrt; private Image unitPrt;
private Button[] buttons; private Button[] buttons;
// Use this for initialization // Use this for initialization
void Awake() void Awake()
...@@ -98,7 +101,8 @@ public class DepPrefab : MonoBehaviour { ...@@ -98,7 +101,8 @@ public class DepPrefab : MonoBehaviour {
switch (but.name) switch (but.name)
{ {
case "Deploy": case "Deploy":
but.onClick.AddListener(delegate () { DeployItem(dep.Value); }); but.onClick.AddListener(delegate () { DeployItem(dep.Value); DeployingObject = this.gameObject; });
break; break;
} }
} }
......
...@@ -105,16 +105,15 @@ public class ProPrefab : MonoBehaviour { ...@@ -105,16 +105,15 @@ public class ProPrefab : MonoBehaviour {
case "Delete": case "Delete":
but.onClick.AddListener(delegate () { but.onClick.AddListener(delegate () {
Debug.Log(but.name); Debug.Log(but.name);
prod.List.Remove(prod); GameManager.I.Game.PlayerInTurn.Production.Remove(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ(); ManagementUIController.GetManagementUIController().MakeProductionQ();
}); });
break; break;
case "Top": case "Top":
but.onClick.AddListener(delegate () { but.onClick.AddListener(delegate () {
Debug.Log(but.name); Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Previous; GameManager.I.Game.PlayerInTurn.Production.Remove(prod);
prod.List.Remove(prod); GameManager.I.Game.PlayerInTurn.Production.AddFirst(prod);
temprod.List.AddFirst(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ(); ManagementUIController.GetManagementUIController().MakeProductionQ();
}); });
break; break;
...@@ -122,8 +121,8 @@ public class ProPrefab : MonoBehaviour { ...@@ -122,8 +121,8 @@ public class ProPrefab : MonoBehaviour {
but.onClick.AddListener(delegate () { but.onClick.AddListener(delegate () {
Debug.Log(but.name); Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Previous; LinkedListNode<Production> temprod = prod.Previous;
prod.List.Remove(prod); GameManager.I.Game.PlayerInTurn.Production.Remove(prod);
temprod.List.AddBefore(temprod, prod); GameManager.I.Game.PlayerInTurn.Production.AddBefore(temprod, prod);
ManagementUIController.GetManagementUIController().MakeProductionQ(); ManagementUIController.GetManagementUIController().MakeProductionQ();
}); });
break; break;
...@@ -131,8 +130,8 @@ public class ProPrefab : MonoBehaviour { ...@@ -131,8 +130,8 @@ public class ProPrefab : MonoBehaviour {
but.onClick.AddListener(delegate () { but.onClick.AddListener(delegate () {
Debug.Log(but.name); Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Next; LinkedListNode<Production> temprod = prod.Next;
prod.List.Remove(prod); GameManager.I.Game.PlayerInTurn.Production.Remove(prod);
temprod.List.AddLast(prod); GameManager.I.Game.PlayerInTurn.Production.AddLast(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ(); ManagementUIController.GetManagementUIController().MakeProductionQ();
}); });
break; break;
...@@ -140,13 +139,12 @@ public class ProPrefab : MonoBehaviour { ...@@ -140,13 +139,12 @@ public class ProPrefab : MonoBehaviour {
but.onClick.AddListener(delegate () { but.onClick.AddListener(delegate () {
Debug.Log(but.name); Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Next; LinkedListNode<Production> temprod = prod.Next;
prod.List.Remove(prod); GameManager.I.Game.PlayerInTurn.Production.Remove(prod);
temprod.List.AddAfter(temprod, prod); GameManager.I.Game.PlayerInTurn.Production.AddAfter(temprod, prod);
ManagementUIController.GetManagementUIController().MakeProductionQ(); ManagementUIController.GetManagementUIController().MakeProductionQ();
}); });
break; break;
} }
ManagementUIController.GetManagementUIController().MakeProductionQ();
} }
} }
} }
......
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