private void DoReadPlanetBattleUpdate() { int LPLanet = FReader.ReadInt32(); bool LInBattle = FReader.ReadBoolean(); PlanetByUID(LPLanet).UpdateBattle(LInBattle); }
private void DoReadShipRemove() { int LUID = FReader.ReadInt32(); bool LDestroy = FReader.ReadBoolean(); LandingByUID(LUID).Ship.Delete(LDestroy); }
private void DoReadPlanetSubscriptionChanged() { int LPLanet = FReader.ReadInt32(); bool LSubscribed = FReader.ReadBoolean(); PlanetByUID(LPLanet).UpdateSubscription(LSubscribed); }
private void DoReadShipCreate() { int tmpUID = FReader.ReadInt32(); Landing tmpLanding = LandingByUID(tmpUID); /* пересмотреть логику */ if (tmpLanding.Ship != null) { return; } Player LOwner = SSHShared.FindPlayer(FReader.ReadInt32()); ShipType LShipType = (ShipType)FReader.ReadInt32(); Ship LShip = new Ship(tmpUID, LOwner, tmpLanding, LShipType) { State = (ShipState)FReader.ReadInt32(), Mode = (ShipMode)FReader.ReadInt32(), AttachedPlanet = PlanetByUID(FReader.ReadInt32()), Count = FReader.ReadInt32(), HP = FReader.ReadInt32(), Fuel = FReader.ReadInt32(), IsCapture = FReader.ReadBoolean(), IsAutoTarget = FReader.ReadBoolean(), }; LShip.Allocate(); }
private void DoReadPlanetStorageResize() { int LPLanet = FReader.ReadInt32(); int LSize = FReader.ReadInt32(); bool LClear = FReader.ReadBoolean(); PlanetByUID(LPLanet).UpdateStorageSize(LSize, LClear); }
private void DoReadLowGravityUpdate() { Planet LSource = PlanetByUID(FReader.ReadInt32()); bool LEnabled = FReader.ReadBoolean(); // Включим или выключим гравитационный потенциал LSource.LowGravity(LEnabled); }
private void DoReadPlanetCoverageUpdate() { int LPlanet = FReader.ReadInt32(); bool LIncrement = FReader.ReadBoolean(); SSHRole LRole = (SSHRole)FReader.ReadInt32(); PlanetByUID(LPlanet).UpdateCoverage(LIncrement, LRole); }
private void DoReadPlanetVisibilityUpdate() { int LPlanet = FReader.ReadInt32(); bool LHardLight = FReader.ReadBoolean(); bool LIncrement = FReader.ReadBoolean(); PlanetByUID(LPlanet).UpdateVisibility(LHardLight, LIncrement); }
private void DoReadShipAttach() { Ship LShip = LandingByUID(FReader.ReadInt32()).Ship; Planet LPlanet = PlanetByUID(FReader.ReadInt32()); bool LCapture = FReader.ReadBoolean(); bool LAutoTarget = FReader.ReadBoolean(); LShip.UpdateAttach(LPlanet, LCapture, LAutoTarget); }
private void DoReadPlanetStorageUpdate() { int LPlanet = FReader.ReadInt32(); int LIndex = FReader.ReadInt32(); int LResID = FReader.ReadInt32(); int LCount = FReader.ReadInt32(); int LFlags = FReader.ReadInt32(); bool LActive = FReader.ReadBoolean(); Engine.UIPlanetDetails.Storage.Change(LPlanet, LIndex, LResID, LCount, LFlags, LActive); }
private void DoReadPortalOpen() { Planet LSource = PlanetByUID(FReader.ReadInt32()); Planet LTarget = PlanetByUID(FReader.ReadInt32()); bool LBreakable = FReader.ReadBoolean(); int LLimit = FReader.ReadInt32(); SSHRole LRole = SSHRole.Neutral; // Если не БЧТ - то нужна роль портала if (LSource.PlanetType != PlanetType.Hole) { LRole = (SSHRole)FReader.ReadInt32(); } // Откроем портал LSource.PortalOpen(LTarget, LBreakable, LLimit, LRole); }
private void DoReadPlanetarLoadPlanets() { int LCount = FReader.ReadInt32(); // Создадим координатную сетку for (int LSectorX = 0; LSectorX < Engine.MapSize.x; LSectorX++) { for (int LSectorY = 0; LSectorY < Engine.MapSize.y; LSectorY++) { new Grid(Engine.UIPanelGrid, LSectorX, LSectorY); } } // Загрузка планет for (int LIndex = 0; LIndex < LCount; LIndex++) { int LUID = FReader.ReadInt32(); int LPosX = FReader.ReadInt32(); int LPosY = FReader.ReadInt32(); int LType = FReader.ReadInt32(); int LMode = FReader.ReadInt32(); Planet LPlanet = new Planet(LUID, Engine.UIBattlefield, LPosX, LPosY, (PlanetType)LType, (PlanetMode)LMode) { Owner = SSHShared.FindPlayer(FReader.ReadInt32()), State = (PlanetState)FReader.ReadInt32(), VisibleHard = FReader.ReadBoolean(), VisibleSoft = FReader.ReadBoolean(), IsCoverageSelf = FReader.ReadBoolean(), IsCoverageFriends = FReader.ReadBoolean(), IsCoverageEnemy = FReader.ReadBoolean(), }; LPlanet.Allocate(); } // Загрузка ссылок for (int LIndex = 0; LIndex < LCount; LIndex++) { int LLinkCount = FReader.ReadInt32(); for (int LLink = 0; LLink < LLinkCount; LLink++) { Engine.MapPlanets[LIndex].Links.Add(Engine.MapPlanets[FReader.ReadInt32()]); } } }
private void DoReadPlayerTechBuildingCreate() { // Перебор всех строений foreach (BuildingType LBuildingType in Enum.GetValues(typeof(BuildingType))) { if (LBuildingType == BuildingType.Empty) { continue; } // Перебор всех технологий foreach (BuildingTech LTech in Enum.GetValues(typeof(BuildingTech))) { if (LTech == BuildingTech.Empty) { continue; } TechInfo LTechInfo = new TechInfo(); LTechInfo.Supported = FReader.ReadBoolean(); if (LTechInfo.Supported) { // Сбор сведений LTechInfo.Name = LTech.ToString(); LTechInfo.Level = FReader.ReadInt32(); LTechInfo.Count = FReader.ReadInt32(); LTechInfo.Levels = new int[6];/*TODO count*/ // Перебор уровней технологий for (int LIndex = 0; LIndex <= 5; LIndex++) { LTechInfo.Levels[LIndex] = FReader.ReadInt32(); } // Установим текущее значение техи LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level]; } Engine.TechBuilding(LBuildingType, LTech, LTechInfo); } } }
private void DoReadPlayerTechShipCreate() { // Перебор всех корабликов foreach (ShipType LShip in Enum.GetValues(typeof(ShipType))) { if (LShip == ShipType.Empty) { continue; } // Перебор всех технологий foreach (ShipTech LTech in Enum.GetValues(typeof(ShipTech))) { if (LTech == ShipTech.Empty) { continue; } TechInfo LTechInfo = new TechInfo(); LTechInfo.Supported = FReader.ReadBoolean(); if (LTechInfo.Supported) { // Сбор сведений LTechInfo.Name = LTech.ToString(); LTechInfo.Level = FReader.ReadInt32(); LTechInfo.Count = FReader.ReadInt32(); LTechInfo.Levels = new int[LTechInfo.Count + 1]; // Перебор уровней технлогий for (int LIndex = 0; LIndex <= LTechInfo.Count; LIndex++) { LTechInfo.Levels[LIndex] = FReader.ReadInt32(); } // Установим текущее значение техи LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level]; } Engine.TechShip(LShip, LTech, LTechInfo); } } }