Commit 864c39d6 authored by redsuncore's avatar redsuncore

Model Updated, selection Queue format made, Attack Prototype made(WIP)

모델 업데이트 됨.
모델에 맞게 몇 가지 코드 수정.

선택 큐 포맷 만들어짐.
생산 큐 버튼 기능을 구현했으나 아직 작동하지 않음. (버튼에 기능 부여하는 코드에 오류 있는듯) (WIP)
공격 기능 생성했으나 버그 있음. (WIP)
parent 3d192b8c
File added
File added
fileFormatVersion: 2
guid: 7af0b65990ee87442b36043d2f0d3ce0
timeCreated: 1519466970
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3dc160019b2765e4a9cb650fe35f9871
timeCreated: 1519466957
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: e4aedecbc18246c41b99e37b20c5907e
timeCreated: 1519466963
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
<!-- Mono library mapping mechanism -->
<configuration>
<dllmap dll="ntdll.dll">
<dllentry os="osx" dll="libc.dylib"/>
<dllentry os="linux,solaris,freebsd" dll="libc.so.6"/>
</dllmap>
</configuration>
fileFormatVersion: 2
guid: 6760212b949a49a4fb3870b8f18521fb
timeCreated: 1519466955
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 65de71d7b02e55b4f890e1d644d6cf54
timeCreated: 1519466970
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 78252bc494b0fee4ab627795a41ab372
timeCreated: 1519466959
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 87a5969a38268d8489dc2f819e746f62
timeCreated: 1519466963
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
File added
fileFormatVersion: 2
guid: f1b296f057caa10468fc5368514bab19
timeCreated: 1519466970
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 07efa08d04626824fb7a05a98bab7bcf
timeCreated: 1519466956
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>CivModel.AI</name></assembly>
<members>
</members>
</doc>
fileFormatVersion: 2
guid: a4c22f93d47aff34ab0465ad060e1349
timeCreated: 1519466963
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
No preview for this file type
No preview for this file type
fileFormatVersion: 2 fileFormatVersion: 2
guid: 14316eefeff7b8c4882dee9cb31df5f1 guid: 14316eefeff7b8c4882dee9cb31df5f1
timeCreated: 1519390593 timeCreated: 1519466970
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
No preview for this file type
No preview for this file type
fileFormatVersion: 2 fileFormatVersion: 2
guid: 51a4ccfc53e3bd3489fedcd4adb9e458 guid: 51a4ccfc53e3bd3489fedcd4adb9e458
timeCreated: 1519390593 timeCreated: 1519466970
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
No preview for this file type
No preview for this file type
fileFormatVersion: 2 fileFormatVersion: 2
guid: f6fc0c038e7ce6640910e93606bc6076 guid: f6fc0c038e7ce6640910e93606bc6076
timeCreated: 1518214576 timeCreated: 1519466970
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
Called when the game should be shutdown. Called when the game should be shutdown.
</summary> </summary>
</member> </member>
<member name="M:CivPresenter.IView.Invoke(System.Action)">
<summary>
Invokes the specified action in the UI thread. This method must be thread-safe.
</summary>
<param name="action">The action.</param>
</member>
<member name="T:CivPresenter.NamespaceDoc"> <member name="T:CivPresenter.NamespaceDoc">
<summary> <summary>
The <see cref="N:CivPresenter"/> namespace of CivPresenter.dll module The <see cref="N:CivPresenter"/> namespace of CivPresenter.dll module
...@@ -92,20 +98,37 @@ ...@@ -92,20 +98,37 @@
<c>null</c> if no action is being done. <c>null</c> if no action is being done.
</summary> </summary>
</member> </member>
<member name="P:CivPresenter.Presenter.SelectedInvestment">
<summary>
Index of the selected investment.
If <see cref="P:CivPresenter.Presenter.SelectedProduction"/> is not <c>-1</c>, this value is <c>-1</c>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductUI"/></c>.
See remarks section for information about the value.
</summary>
<remarks>
<list type="bullet">
<item><c>0</c> if <see cref="P:CivModel.Player.TaxRate"/> is selected.</item>
<item><c>1</c> if <see cref="P:CivModel.Player.EconomicInvestmentRatio"/> is selected.</item>
<item><c>2</c> if <see cref="P:CivModel.Player.ResearchInvestmentRatio"/> is selected.</item>
<item><c>3</c> if <see cref="P:CivModel.Player.LogisticInvestmentRatio"/> is selected.</item>
<item><c>-1</c> if there is no selected deploy.</item>
</list>
</remarks>
</member>
<member name="P:CivPresenter.Presenter.SelectedDeploy"> <member name="P:CivPresenter.Presenter.SelectedDeploy">
<summary> <summary>
Index of the selected deploy to <see cref="P:CivModel.Player.Deployment"/> list. Index of the selected deploy to <see cref="P:CivModel.Player.Deployment"/> list.
<c>-1</c> if there is no selected deploy. <c>-1</c> if there is no selected deploy.
If <see cref="P:CivPresenter.Presenter.SelectedProduction"/> is not <c>-1</c>, this value is <c>-1</c>. If <see cref="P:CivPresenter.Presenter.SelectedProduction"/> or <see cref="P:CivPresenter.Presenter.SelectedInvestment"/> is not <c>-1</c>, this value is <c>-1</c>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductUI"/></c> This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductUI"/></c>.
</summary> </summary>
</member> </member>
<member name="P:CivPresenter.Presenter.SelectedProduction"> <member name="P:CivPresenter.Presenter.SelectedProduction">
<summary> <summary>
Index of the selected production to <see cref="P:CivModel.Player.Production"/> list. Index of the selected production to <see cref="P:CivModel.Player.Production"/> list.
<c>-1</c> if there is no selected production. <c>-1</c> if there is no selected production.
If <see cref="P:CivPresenter.Presenter.SelectedDeploy"/> is not <c>-1</c>, this value is <c>-1</c>. If <see cref="P:CivPresenter.Presenter.SelectedDeploy"/> or <see cref="P:CivPresenter.Presenter.SelectedInvestment"/> is not <c>-1</c>, this value is <c>-1</c>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductUI"/> || <see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductAdd"/></c> This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductUI"/> || <see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductAdd"/></c>.
</summary> </summary>
</member> </member>
<member name="P:CivPresenter.Presenter.IsProductManipulating"> <member name="P:CivPresenter.Presenter.IsProductManipulating">
...@@ -116,7 +139,7 @@ ...@@ -116,7 +139,7 @@
</member> </member>
<member name="P:CivPresenter.Presenter.AvailableProduction"> <member name="P:CivPresenter.Presenter.AvailableProduction">
<summary> <summary>
The list of the available production, retrieved by <see cref="M:CivModel.Player.GetAvailableProduction"/> The list of the available production, retrieved by <see cref="P:CivModel.Player.AvailableProduction"/>
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductAdd"/></c> This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.ProductAdd"/></c>
</summary> </summary>
</member> </member>
...@@ -138,6 +161,37 @@ ...@@ -138,6 +161,37 @@
and the value is the number of a special action. and the value is the number of a special action.
</summary> </summary>
</member> </member>
<member name="P:CivPresenter.Presenter.AcceptedQuests">
<summary>
The list of <see cref="T:CivModel.Quest"/> of <see cref="P:CivModel.Game.PlayerInTurn"/> whose status is <see cref="F:CivModel.QuestStatus.Accepted"/>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.Quest"/></c>.
</summary>
</member>
<member name="P:CivPresenter.Presenter.DeployedQuests">
<summary>
The list of <see cref="T:CivModel.Quest"/> of <see cref="P:CivModel.Game.PlayerInTurn"/> whose status is <see cref="F:CivModel.QuestStatus.Deployed"/>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.Quest"/></c>.
</summary>
</member>
<member name="P:CivPresenter.Presenter.CompletedQuests">
<summary>
The list of <see cref="T:CivModel.Quest"/> of <see cref="P:CivModel.Game.PlayerInTurn"/> whose status is <see cref="F:CivModel.QuestStatus.Completed"/>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.Quest"/></c>.
</summary>
</member>
<member name="P:CivPresenter.Presenter.DisabledQuests">
<summary>
The list of <see cref="T:CivModel.Quest"/> of <see cref="P:CivModel.Game.PlayerInTurn"/> whose status is <see cref="F:CivModel.QuestStatus.Disabled"/>.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.Quest"/></c>.
</summary>
</member>
<member name="P:CivPresenter.Presenter.SelectedQuest">
<summary>
Index of the selected quest to <see cref="P:CivModel.Player.Quests"/> list.
<c>-1</c> if there is no selected quest.
This value is valid iff <c><see cref="P:CivPresenter.Presenter.State"/> == <see cref="F:CivPresenter.Presenter.States.Quest"/></c>.
</summary>
</member>
<member name="P:CivPresenter.Presenter.SaveFile"> <member name="P:CivPresenter.Presenter.SaveFile">
<summary> <summary>
The path of the save file. The path of the save file.
...@@ -212,6 +266,11 @@ ...@@ -212,6 +266,11 @@
Gives the command [skip]. Gives the command [skip].
</summary> </summary>
</member> </member>
<member name="M:CivPresenter.Presenter.CommandSleep">
<summary>
Gives the command [sleep].
</summary>
</member>
<member name="M:CivPresenter.Presenter.CommandRefocus"> <member name="M:CivPresenter.Presenter.CommandRefocus">
<summary> <summary>
Gives the command [refocus]. Gives the command [refocus].
...@@ -251,6 +310,12 @@ ...@@ -251,6 +310,12 @@
This method may introduce <see cref="F:CivPresenter.Presenter.States.ProductUI"/> state. This method may introduce <see cref="F:CivPresenter.Presenter.States.ProductUI"/> state.
</summary> </summary>
</member> </member>
<member name="M:CivPresenter.Presenter.CommandQuest">
<summary>
Gives the command [quest].
This method may introduce <see cref="F:CivPresenter.Presenter.States.Quest"/> state.
</summary>
</member>
<member name="T:CivPresenter.Presenter.States"> <member name="T:CivPresenter.Presenter.States">
<summary> <summary>
Indicates the state of <see cref="T:CivPresenter.Presenter"/>. Indicates the state of <see cref="T:CivPresenter.Presenter"/>.
...@@ -313,6 +378,13 @@ ...@@ -313,6 +378,13 @@
In this state, <see cref="P:CivPresenter.Presenter.DeployProduction"/> indicates the production to deploy. In this state, <see cref="P:CivPresenter.Presenter.DeployProduction"/> indicates the production to deploy.
</summary> </summary>
</member> </member>
<member name="F:CivPresenter.Presenter.States.Quest">
<summary>
State [quest]. This state indicates user is viewing the list of quests.
<see cref="M:CivPresenter.Presenter.CommandQuest"/> method may introduce this state.
In this state, asdf indicates asdf.
</summary>
</member>
<member name="F:CivPresenter.Presenter.States.Victory"> <member name="F:CivPresenter.Presenter.States.Victory">
<summary> <summary>
State [victory]. This state indicates user is viewing a <strong>victory</strong> screen. State [victory]. This state indicates user is viewing a <strong>victory</strong> screen.
...@@ -323,5 +395,10 @@ ...@@ -323,5 +395,10 @@
State [defeated]. This state indicates user is viewing a <strong>defeated</strong> screen. State [defeated]. This state indicates user is viewing a <strong>defeated</strong> screen.
</summary> </summary>
</member> </member>
<member name="F:CivPresenter.Presenter.States.AIControl">
<summary>
State [AI control]. This state indicates AI player is doing his job now.
</summary>
</member>
</members> </members>
</doc> </doc>
File added
fileFormatVersion: 2
guid: d96bb471b14ad0446853566b2e6ca689
timeCreated: 1519466961
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: ee2e55b47f8f7e74a8a9825df3bdf23b
timeCreated: 1519466963
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 73a1545fcdff723498d02b6b7849993c
timeCreated: 1519466958
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 012961f95c5d336479d73aba9905aef3
timeCreated: 1519466963
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 58435f9b226203141837f863a18e6f00
folderAsset: yes
timeCreated: 1519466955
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 278793e472b8b3f4296728510825a1e6
timeCreated: 1519466957
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
...@@ -57,7 +57,7 @@ public class GameManager : MonoBehaviour { ...@@ -57,7 +57,7 @@ public class GameManager : MonoBehaviour {
} }
// Use this when scene changing exists // Use this when scene changing exists
// DontDestroyOnLoad(gameObject); // DontDestroyOnLoad(gameObject);
_game = new CivModel.Game(GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer); _game = new CivModel.Game(GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer, new GameSchemeFactory(), new IGameSchemeFactory[] { new CivModel.AI.GameSchemeFactory()});
_game.StartTurn(); _game.StartTurn();
} }
...@@ -109,10 +109,14 @@ public class GameManager : MonoBehaviour { ...@@ -109,10 +109,14 @@ public class GameManager : MonoBehaviour {
{ {
if (tile.isFlickering) if (tile.isFlickering)
{ {
if (tile.point.TileBuilding != null) if(SelectedActor.HoldingAttackAct != null)
SelectedActor.AttackTo(tile.point.TileBuilding); {
else if (tile.point.Unit != null) SelectedActor.HoldingAttackAct.Act(tile.point);
SelectedActor.AttackTo(tile.point.Unit); }
else if(SelectedActor.MovingAttackAct != null)
{
SelectedActor.MovingAttackAct.Act(tile.point);
}
else else
Debug.Log("잘못된 공격 대상"); Debug.Log("잘못된 공격 대상");
} }
...@@ -121,7 +125,7 @@ public class GameManager : MonoBehaviour { ...@@ -121,7 +125,7 @@ public class GameManager : MonoBehaviour {
} }
Unit unit = tile.point.Unit; Unit unit = tile.point.Unit;
if (unit != null) if (unit != null)
{ {
SelectUnit(unit); SelectUnit(unit);
} }
} }
...@@ -251,9 +255,9 @@ public class GameManager : MonoBehaviour { ...@@ -251,9 +255,9 @@ public class GameManager : MonoBehaviour {
SelectNextUnit(); SelectNextUnit();
if (_selectedActor == null) if (_selectedActor == null)
{ {
if (_game.PlayerInTurn.Cities.FirstOrDefault() is CivModel.Common.CityCenter) if (_game.PlayerInTurn.Cities.FirstOrDefault() is CivModel.CityBase)
{ {
CivModel.Common.CityCenter city = _game.PlayerInTurn.Cities.FirstOrDefault(); CityBase city = _game.PlayerInTurn.Cities.FirstOrDefault();
if (city.PlacedPoint is CivModel.Terrain.Point) if (city.PlacedPoint is CivModel.Terrain.Point)
Focus(city.PlacedPoint.Value); Focus(city.PlacedPoint.Value);
} }
......
...@@ -4,6 +4,7 @@ using UnityEngine; ...@@ -4,6 +4,7 @@ using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using CivModel; using CivModel;
using CivModel.Common; using CivModel.Common;
using System.Linq;
public class ManagementUIController : MonoBehaviour { public class ManagementUIController : MonoBehaviour {
...@@ -13,6 +14,7 @@ public class ManagementUIController : MonoBehaviour { ...@@ -13,6 +14,7 @@ public class ManagementUIController : MonoBehaviour {
private LinkedList<Production> mProduction; private LinkedList<Production> mProduction;
private LinkedList<Production> mDeployment; private LinkedList<Production> mDeployment;
//private IReadOnlyList<IProductionFactory> facList;
private IReadOnlyList<IProductionFactory> facList; private IReadOnlyList<IProductionFactory> facList;
private GameObject gameManagerObject; private GameObject gameManagerObject;
...@@ -23,7 +25,7 @@ public class ManagementUIController : MonoBehaviour { ...@@ -23,7 +25,7 @@ public class ManagementUIController : MonoBehaviour {
private List<GameObject> DQlist; private List<GameObject> DQlist;
private List<GameObject> EpicQlist, HighQlist, IntermediateQlist, LowQlist; // Unit production private List<GameObject> EpicQlist, HighQlist, IntermediateQlist, LowQlist; // Unit production
private List<GameObject> CityQlist, CityBuildingQlist, NormalBuildingQlist; private List<GameObject> CityQlist, CityBuildingQlist, NormalBuildingQlist;
private List<List<GameObject>> ASQlist;
public GameObject proPrefab; public GameObject proPrefab;
public GameObject depPrefab; public GameObject depPrefab;
public GameObject productablePrefab; // prefab templates public GameObject productablePrefab; // prefab templates
...@@ -34,43 +36,115 @@ public class ManagementUIController : MonoBehaviour { ...@@ -34,43 +36,115 @@ public class ManagementUIController : MonoBehaviour {
public GameObject CityQueue, CityBuildingQueue, NormalBuildingQueue; // Building production public GameObject CityQueue, CityBuildingQueue, NormalBuildingQueue; // Building production
private List<GameObject> MakeSelectionQ(List<GameObject> SQlist, GameObject productableQueue) private void MakeSelectionQ()//선택 큐 프리팹 생성 함수
{ {
List<GameObject> tempList = new List<GameObject>(); Debug.Log("ALL SelectList startMaking");
Debug.Log("SelectList startMaking"); facList = game.PlayerInTurn.AvailableProduction.ToList(); //전체 선택 목록 받아오기
foreach (GameObject sq in SQlist)
{
Destroy(sq);
}
SQlist.Clear();
facList = game.PlayerInTurn.GetAvailableProduction();
//facList의 변경으로 Epic-High-intermediate-Low 변경 가능. 하지만 지금은 설정되지 않았음(Epic에 생성) //facList의 변경으로 Epic-High-intermediate-Low 변경 가능. 하지만 지금은 설정되지 않았음(Epic에 생성)
Debug.Log(facList + " " + facList.Count); Debug.Log(facList + " " + facList.Count);
Debug.Log("facList : " + facList.Count); Debug.Log("facList : " + facList.Count);
Debug.Log("SelectList Updated"); Debug.Log("ALL SelectList Updated");
DeleteAllSQ();
foreach (IProductionFactory fac in facList) foreach (IProductionFactory fac in facList)
{ {
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity); if(fac.ProductionResultType != null)
SPrefab.transform.SetParent(productableQueue.transform); {
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f); PartSelectionQ(EpicQlist, EpicQueue, fac);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f); }
tempList.Add(SPrefab.GetComponent<SelPrefab>().MakeItem(fac)); }
//내용물 없을 때 빈칸 채우기
foreach(var qlist in ASQlist)
{
if (qlist.Count == 0)
{
GameObject productableQueue;
switch(ASQlist.IndexOf(qlist))
{
case 0:
productableQueue = EpicQueue;
break;
case 1:
productableQueue = HighQueue;
break;
case 2:
productableQueue = IntermediateQueue;
break;
case 3:
productableQueue = LowQueue;
break;
case 4:
productableQueue = CityQueue;
break;
case 5:
productableQueue = CityBuildingQueue;
break;
case 6:
productableQueue = NormalBuildingQueue;
break;
default:
productableQueue = null;
Debug.Log("Error : qlist = " + qlist);
throw new MissingComponentException();
break;
}
Debug.Log("SelectionList : " + ASQlist.IndexOf(qlist) + "null");
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
SPrefab.transform.SetParent(productableQueue.transform);
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
SPrefab.GetComponent<SelPrefab>().MakeItem();
qlist.Add(SPrefab);
}
}
}
//각 Factory의 분야를 읽어서 해당하는 Queue에 집어넣는 역할
private GameObject PartSelectionQ(List<GameObject> SQlist, GameObject productableQueue, IProductionFactory fac)
{
if (fac.ProductionResultType == null)
{
return null;
} }
if (facList.Count == 0) var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
SPrefab.transform.SetParent(productableQueue.transform);
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
SPrefab.GetComponent<SelPrefab>().MakeItem(fac);
SQlist.Add(SPrefab);
return SPrefab;
}
//선택 큐 초기화(GameObject)
private void DeleteAllSQ()
{
DeleteSQ(EpicQlist);
DeleteSQ(HighQlist);
DeleteSQ(IntermediateQlist);
DeleteSQ(LowQlist);
DeleteSQ(NormalBuildingQlist);
DeleteSQ(CityQlist);
DeleteSQ(CityBuildingQlist);
ASQlist.Clear();
ASQlist.Add(EpicQlist = new List<GameObject>());
ASQlist.Add(HighQlist = new List<GameObject>());
ASQlist.Add(IntermediateQlist = new List<GameObject>());
ASQlist.Add(LowQlist = new List<GameObject>());
ASQlist.Add(CityQlist = new List<GameObject>());
ASQlist.Add(CityBuildingQlist = new List<GameObject>());
ASQlist.Add(NormalBuildingQlist = new List<GameObject>());
}
//선택 큐 초기화에 쓰이는 함수
private void DeleteSQ(List<GameObject> SQlist)
{
foreach (GameObject sq in SQlist)
{ {
Debug.Log("SelectList null"); Destroy(sq);
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
SPrefab.transform.SetParent(productableQueue.transform);
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
SPrefab.GetComponent<SelPrefab>().MakeItem();
tempList.Add(SPrefab);
} }
return tempList; SQlist.Clear();
} }
//ManageMentUI 갱신 함수
public void ManageFunction() // Management tab on/off button -> ManageMentUIActive public void ManageFunction() // Management tab on/off button -> ManageMentUIActive
{ {
EpicQlist = MakeSelectionQ(EpicQlist, EpicQueue); MakeSelectionQ();
MakeProductionQ(); MakeProductionQ();
MakeDeploymentQ(); MakeDeploymentQ();
foreach (GameObject sq in EpicQlist) foreach (GameObject sq in EpicQlist)
...@@ -102,14 +176,14 @@ public class ManagementUIController : MonoBehaviour { ...@@ -102,14 +176,14 @@ public class ManagementUIController : MonoBehaviour {
{ {
gameManager = GameManager.I; gameManager = GameManager.I;
game = gameManager.Game; game = gameManager.Game;
ASQlist = new List<List<GameObject>>();
EpicQlist = new List<GameObject>(); ASQlist.Add(EpicQlist = new List<GameObject>());
HighQlist = new List<GameObject>(); ASQlist.Add(HighQlist = new List<GameObject>());
IntermediateQlist = new List<GameObject>(); ASQlist.Add(IntermediateQlist = new List<GameObject>());
LowQlist = new List<GameObject>(); ASQlist.Add(LowQlist = new List<GameObject>());
CityQlist = new List<GameObject>(); ASQlist.Add(CityQlist = new List<GameObject>());
CityBuildingQlist = new List<GameObject>(); ASQlist.Add(CityBuildingQlist = new List<GameObject>());
NormalBuildingQlist = new List<GameObject>(); ASQlist.Add(NormalBuildingQlist = new List<GameObject>());
PQlist = new List<GameObject>(); PQlist = new List<GameObject>();
DQlist = new List<GameObject>(); DQlist = new List<GameObject>();
...@@ -129,6 +203,7 @@ public class ManagementUIController : MonoBehaviour { ...@@ -129,6 +203,7 @@ public class ManagementUIController : MonoBehaviour {
public void MakeProductionQ() public void MakeProductionQ()
{ {
ProPrefab.ResetTestingNumber();
List<GameObject> tempList = new List<GameObject>(); List<GameObject> tempList = new List<GameObject>();
Debug.Log("ProductionList startMaking"); Debug.Log("ProductionList startMaking");
foreach (GameObject pq in PQlist) foreach (GameObject pq in PQlist)
......
...@@ -107,7 +107,7 @@ public class DepPrefab : MonoBehaviour { ...@@ -107,7 +107,7 @@ public class DepPrefab : MonoBehaviour {
public void DeployItem(Production dep) public void DeployItem(Production dep)
{ {
if (dep.Completed) if (dep.IsCompleted)
{ {
PseudoFSM.I.DepStateEnter(dep); PseudoFSM.I.DepStateEnter(dep);
UIManager.I.MapUIActive(); UIManager.I.MapUIActive();
......
...@@ -8,6 +8,7 @@ using CivModel.Common; ...@@ -8,6 +8,7 @@ using CivModel.Common;
public class ProPrefab : MonoBehaviour { public class ProPrefab : MonoBehaviour {
private static int unitNum = 0;
private Text[] textarguments; private Text[] textarguments;
private Image unitPrt; private Image unitPrt;
private Button[] buttons; private Button[] buttons;
...@@ -47,10 +48,11 @@ public class ProPrefab : MonoBehaviour { ...@@ -47,10 +48,11 @@ public class ProPrefab : MonoBehaviour {
txt.text = "?턴 이후 배치 가능."; txt.text = "?턴 이후 배치 가능.";
break; break;
case "UnitName": case "UnitName":
txt.text = nameofProduction; txt.text = nameofProduction + " " + unitNum++;
break; break;
case "Required Resource": case "Required Resource":
txt.text = "금 : 턴당 " + "?" + " (" + "?" + "/" + Convert.ToInt32(prod.TotalCost).ToString() + ")"+"\n노동력 : 턴당 " + "?" + " (" + Convert.ToInt32(prod.LaborInputed).ToString() + "/" + Convert.ToInt32(prod.TotalCost).ToString() + ")"; txt.text = "금 : 턴당 " + "?" + " (" + "?" + "/" + Convert.ToInt32(prod.TotalGoldCost).ToString() + ")"
+"\n노동력 : 턴당 " + "?" + " (" + Convert.ToInt32(prod.LaborInputed).ToString() + "/" + Convert.ToInt32(prod.TotalLaborCost).ToString() + ")";
break; break;
} }
} }
...@@ -64,10 +66,10 @@ public class ProPrefab : MonoBehaviour { ...@@ -64,10 +66,10 @@ public class ProPrefab : MonoBehaviour {
switch (txt.name) switch (txt.name)
{ {
case "TurnsLeft": case "TurnsLeft":
txt.text = "비었음"; txt.text = "생산 중인 유닛/건물이 없습니다!\n 오른쪽의 탭에서 생산을 선택하세요!";
break; break;
case "UnitName": case "UnitName":
txt.text = "B었음"; txt.text = "";
break; break;
case "Required Resource": case "Required Resource":
txt.text = ""; txt.text = "";
...@@ -98,7 +100,58 @@ public class ProPrefab : MonoBehaviour { ...@@ -98,7 +100,58 @@ public class ProPrefab : MonoBehaviour {
} }
foreach (Button but in buttons) foreach (Button but in buttons)
{ {
switch (but.name)
{
case "Delete":
but.onClick.AddListener(delegate () {
Debug.Log(but.name);
prod.List.Remove(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ();
});
break;
case "Top":
but.onClick.AddListener(delegate () {
Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Previous;
prod.List.Remove(prod);
temprod.List.AddFirst(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ();
});
break;
case "Up":
but.onClick.AddListener(delegate () {
Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Previous;
prod.List.Remove(prod);
temprod.List.AddBefore(temprod, prod);
ManagementUIController.GetManagementUIController().MakeProductionQ();
});
break;
case "Down":
but.onClick.AddListener(delegate () {
Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Next;
prod.List.Remove(prod);
temprod.List.AddLast(prod);
ManagementUIController.GetManagementUIController().MakeProductionQ();
});
break;
case "Bottom":
but.onClick.AddListener(delegate () {
Debug.Log(but.name);
LinkedListNode<Production> temprod = prod.Next;
prod.List.Remove(prod);
temprod.List.AddAfter(temprod, prod);
ManagementUIController.GetManagementUIController().MakeProductionQ();
});
break;
}
ManagementUIController.GetManagementUIController().MakeProductionQ();
} }
} }
} }
public static void ResetTestingNumber()
{
unitNum = 0;
}
} }
...@@ -5,6 +5,7 @@ using UnityEngine; ...@@ -5,6 +5,7 @@ using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using CivModel; using CivModel;
using CivModel.Common; using CivModel.Common;
using System.Linq;
public class SelPrefab : MonoBehaviour public class SelPrefab : MonoBehaviour
{ {
...@@ -89,7 +90,7 @@ public class SelPrefab : MonoBehaviour ...@@ -89,7 +90,7 @@ public class SelPrefab : MonoBehaviour
private void ProduceItem(int i) private void ProduceItem(int i)
{ {
IProductionFactory factory = GameManager.I.Game.PlayerInTurn.GetAvailableProduction()[i]; IProductionFactory factory = GameManager.I.Game.PlayerInTurn.AvailableProduction.ToList()[i];
GameManager.I.Game.PlayerInTurn.Production.AddLast(factory.Create(GameManager.I.Game.PlayerInTurn)); GameManager.I.Game.PlayerInTurn.Production.AddLast(factory.Create(GameManager.I.Game.PlayerInTurn));
Debug.Log(i + " inputed"); Debug.Log(i + " inputed");
......
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