public MainGameManager(GameSetup gameSetup) { MapAssetSet assetSet = gameSetup.MapDefinition.GetMapAssetSet(); Map map = new Map(assetSet.MapSetup); IEnumerable <PlayerSetup> playerSetups = PlayerSetup.CreateFromMapDefinition(assetSet.MapSetup); GameTurnTransition initialState = GetInitialState(playerSetups, map); _turns.Add(initialState); _provinceNeighbors = new ProvinceNeighborsTable(CurrentState); ObjectManager = new UnityObjectManager(map, assetSet, gameSetup.MapPrefab, gameSetup.FactionPrefab, gameSetup.OrderIndicatorPrefab, gameSetup.ScreenCanvas, initialState.AfterEverything, playerSetups); InteractionManager = new InteractionManager(this, map, gameSetup, ObjectManager, playerSetups); DisplayManager = new GameDisplayManager(this, gameSetup, playerSetups.Select(item => item.Faction), map, ObjectManager, InteractionManager.Factions, initialState.AfterEverything); }
public MapDisplay(GameSetup gameSetup, Map map, UnityObjectManager objectManager) { _mapUnityObject = objectManager.MapObject; _skyMat = gameSetup.SkyMat; Map = map; _dictionary = MakeTilesDictionary(map); }
public MapInteraction(InteractionManager main, Map map, UnityObjectManager objectManager) { InteractionMain = main; _tileByIndex = GetTileByIndex(map); _tileLayermask = 1 << LayerMask.NameToLayer("UI"); _mapObject = objectManager.MapObject; }
private void Init() { SerializeTool.serializeTool = new JsonDotNetSerializeTool(); IO.ioTool = new FileStreamIOTool(Application.dataPath + "/Resources"); Crypto.cryptoTool = new NoCryptoTool(); UnityObjectManager.RefreshGos(); UnityObjectManager.RefreshCos(); }
public FactionsDisplayManager(MainGameManager mainGameManager, Canvas hudCanvas, GameObject factionsPrefab, UnityObjectManager objectManager, FactionsInteractionManager interactionManager, MapInteraction mapInteraction) { _mainGameManager = mainGameManager; Factions = CreateFactionsDisplay(objectManager, interactionManager, mapInteraction); }
private IEnumerable <FactionDisplay> CreateFactionsDisplay(UnityObjectManager objectManager, FactionsInteractionManager interactionManager, MapInteraction mapInteraction) { List <FactionDisplay> ret = new List <FactionDisplay>(); foreach (FactionInteraction faction in interactionManager.Factions) { FactionDisplay factionDisplay = new FactionDisplay(faction, objectManager, interactionManager, mapInteraction); ret.Add(factionDisplay); } return(ret); }
public InteractionManager(MainGameManager mainManager, Map map, GameSetup gameSetup, UnityObjectManager unityObjectManager, IEnumerable <PlayerSetup> playerSetups) { gameSetup.NextTurnButton.onClick.AddListener(() => AdvanceGame()); _mainManager = mainManager; Map = new MapInteraction(this, map, mainManager.ObjectManager); Timeline = new TimelineInteraction(this); Factions = new FactionsInteractionManager(unityObjectManager.Factions); }
/// <summary> /// 加载数据 /// </summary> public void LoadReplayData() { operationInfo.Clear(); string data = System.Text.Encoding.UTF8.GetString(IO.Read("ReplayData.txt")); JObject jobect = JObject.Parse(data); operationInfo = SerializeTool.Deserialize <List <OperationInfo> >(jobect["ReplayInfo"].ToString()); foreach (var item in operationInfo) { item.replayEntity = (IRePlayEvent)UnityObjectManager.GetComponentByID(item.comID); } Debug.Log("Load Success"); }
public FactionDisplay(FactionInteraction factionInteraction, UnityObjectManager objectManager, FactionsInteractionManager interactionManager, MapInteraction mapInteraction) { _objectManager = objectManager; _mapInteraction = mapInteraction; _unityObject = objectManager.GetUnityObject(factionInteraction.Faction);; Faction = _unityObject.Faction; _unityObject.Text.text = Faction.Name; _unityObject.Text.color = Faction.Color; _interactionManager = interactionManager; _factionInteraction = factionInteraction; _orderIndicators = objectManager.GetOrderIndicatorsFor(factionInteraction.Faction).ToList().AsReadOnly(); }
public GameDisplayManager(MainGameManager mainManager, GameSetup gameSetup, IEnumerable <Faction> factions, Map map, UnityObjectManager objectManager, FactionsInteractionManager interactionManager, GameState initialState) { _provinces = new Dictionary <Province, ProvinceDisplay>(); _mainManager = mainManager; _factions = new FactionsDisplayManager(mainManager, gameSetup.ScreenCanvas, gameSetup.FactionPrefab, objectManager, interactionManager, _mainManager.InteractionManager.Map); Map = new MapDisplay(gameSetup, map, objectManager); UpdateDisplayWrappers(initialState); }
/// <summary> /// 统一调用具体实例化的接口方法 /// </summary> /// <param name="_replayentity"></param> /// <param name="_replayinfo"></param> /// <param name="_param"></param> public void ExcuteIRePlay(IRePlayEvent _replayentity, string _replayinfo, object[] _param) { _replayentity.ExcuteMethod(_replayinfo, _param); operationInfo.Add(new OperationInfo(Time.frameCount, UnityObjectManager.GetComponentID(_replayentity as Component), _replayinfo, _param)); }