public void GetAllBarriersByExtentTest() { BarrierManager target = new BarrierManager(); var list = target.GetAllBarrierByExtent(102.06916479819719, 34.411004748036675, 105.26451464664198, 36.208389037786873); Assert.AreNotEqual(list.Count, 0); }
private static void InitializeSpells() { if (mustDebug) { Game.PrintChat("InitializeSpells Start"); } IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); itemManager = new ItemManager(); Q = new Spell(SpellSlot.Q); W = new Spell(SpellSlot.W, 950); W.SetSkillshot(0.25f, 270f, 1400f, false, SkillshotType.SkillshotCircle); E = new Spell(SpellSlot.E, 1200); R = new Spell(SpellSlot.R, 850); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); if (mustDebug) { Game.PrintChat("InitializeSpells Finish"); } }
private static void InitializeSpells() { if (mustDebug) { Game.PrintChat("InitializeSpells Start"); } IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); Q = new Spell(SpellSlot.Q, 630); W = new Spell(SpellSlot.W, 600); E = new Spell(SpellSlot.E, 600); R = new Spell(SpellSlot.R); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); if (mustDebug) { Game.PrintChat("InitializeSpells Finish"); } }
void Start() { if (ServiceLocator.Current.Get <BarrierManager>() == null) { ServiceLocator.OnServiceRegistered += (s) => { if (s is BarrierManager) { barrierManager = ServiceLocator.Current.Get <BarrierManager>(); barrierManager.transforms.Add(new BarrierStuff() { offset = offset, transform = transform }); } }; } else { barrierManager = ServiceLocator.Current.Get <BarrierManager>(); barrierManager.transforms.Add(new BarrierStuff() { offset = offset, transform = transform }); } }
private static void InitializeSpells() { if (mustDebug) { Game.PrintChat("InitializeSpells Start"); } IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); Q = new Spell(SpellSlot.Q, 1000); Q.SetSkillshot(0.25f, 70f, 1650f, true, SkillshotType.SkillshotLine); W = new Spell(SpellSlot.W, 130); E = new Spell(SpellSlot.E, 1200); E.SetSkillshot(0.25f, 120f, 1400f, false, SkillshotType.SkillshotLine); R = new Spell(SpellSlot.R, 1200); R.SetSkillshot(1.5f, 225f, float.MaxValue, false, SkillshotType.SkillshotCircle); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); if (mustDebug) { Game.PrintChat("InitializeSpells Finish"); } }
private static void InitializeSpells() { if (mustDebug) { Game.PrintChat("InitializeSpells Start"); } IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); MinionListToIgnore = new List <int>(); Q = new Spell(SpellSlot.Q, 630); Q.SetTargetted(0.2f, float.MaxValue); W = new Spell(SpellSlot.W, 600); E = new Spell(SpellSlot.E, 600); E.SetTargetted(0.2f, float.MaxValue); R = new Spell(SpellSlot.R); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); if (mustDebug) { Game.PrintChat("InitializeSpells Finish"); } }
// Use this for initialization void Start() { Instance = this; queue = new LinkedList <Transform>(); GameManager.Instance.GameStart += GameStart; GameManager.Instance.GameOver += GameOver; this.enabled = false; }
public ZzjgServiceImpl() { this.hotelManager = new HotelManager(); this.cyberBarManager = new CyberBarManager(); this.policeOrgManager = new PoliceOrgManager(); this.templeManager = new TempleManager(); this.barrierManager = new BarrierManager(); }
private void initDrawableManagers() { m_EnemyManager = new EnemyManager(this); m_BarrierManager = new BarrierManager(this, m_PlayersManager[0].StartPosition.Y, m_PlayersManager[0].Height); m_EnemyManager.MatrixReachedBottomWindow += onGameOver; m_EnemyManager.AllEnemiesDied += enemyManager_AllEnemiesDied; m_PlayersManager.AllPlayersDied += onGameOver; }
public void Update() { if (isAlive) { float deltaX = speed * GfxTools.Win.deltaTime; position.X += deltaX; float maxX = position.X + width / 2; float minX = position.X - width / 2; if (maxX > GfxTools.Win.width - distToSide) { float overflowX = maxX - (GfxTools.Win.width - distToSide); position.X -= overflowX; deltaX -= overflowX; } else if (minX < distToSide) { float overflowX = minX - distToSide; position.X -= overflowX; deltaX -= overflowX; } sprite.Translate(deltaX, 0); //Translate heart sprite energy under player for (int i = 0; i < heartsEnergy.Length; i++) { if (heartsEnergy[i] != null) { heartsEnergy[i].Translate(deltaX, 0); } } for (int i = 0; i < bullets.Length; i++) { if (bullets[i].IsAlive) { bullets[i].Update(); // Console.WriteLine("X: " + bullets[i].Position.X + " Y: " + bullets[i].Position.Y); if (BarrierManager.Collides(bullets[i].Position, bullets[i].GetWidth() / 2)) //perchè non /2 { // Game.Stop(); bullets[i].IsAlive = false; } else if (EnemyMng.CollideWithBullet(bullets[i])) { bullets[i].IsAlive = false; Game.AddScore(5); } } } } }
// public class ObserverMessage : MessageBase // { // public Replay.Message Message; // // public override void Serialize(NetworkWriter writer) // { // GeneratedNetworkCode._WriteMessage_Replay(writer, this.Message); // } // // public override void Deserialize(NetworkReader reader) // { // this.Message = GeneratedNetworkCode._ReadMessage_Replay(reader); // } // } public void LaunchGame(bool spawnObjects = true) { MapLoader = new AssetLoader(); MapLoader.LoadAssetBundle("Bundles/scenes/maps.bundle"); MapLoader.LoadAsset( $"archive:/buildplayer-robotfactory_opu_gamemode/buildplayer-{GameConfig.Map.ToLower()}"); MapLoader.ConstructCaches(); AssetsLoader = new AssetLoader(); AssetsLoader.LoadAsset("resources.assets"); AssetsLoader.ConstructCaches(); MiscLoader = new AssetLoader(); MiscLoader.LoadAssetBundle("Bundles/scenes/frontend.bundle"); MiscLoader.LoadAsset("archive:/buildplayer-options_ui/buildplayer-clientenvironmentsingletons"); MiscLoader.ConstructCaches(); if (!spawnObjects) { return; } SpawnObject(MiscLoader, "ApplicationSingletonsNetId", out _); SpawnObject(MiscLoader, "GameSceneSingletons", out var gameSceneSingletons); TheatricsManager = gameSceneSingletons.GetComponent <TheatricsManager>(); AbilityModManager = gameSceneSingletons.GetComponent <AbilityModManager>(); SpawnObject(MiscLoader, "SharedEffectBarrierManager", out SharedEffectBarrierManager); SpawnObject(MiscLoader, "SharedActionBuffer", out SharedActionBuffer); SharedActionBuffer.Networkm_actionPhase = ActionBufferPhase.Done; SpawnScene(MapLoader, 1, out var commonGameLogic); InterfaceManager = commonGameLogic.GetComponent <InterfaceManager>(); GameFlow = commonGameLogic.GetComponent <GameFlow>(); // MatchLogger = commonGameLogic.GetComponent<MatchLogger>(); ServerCombatManager = commonGameLogic.GetComponent <ServerCombatManager>(); ServerEffectManager = commonGameLogic.GetComponent <ServerEffectManager>(); TeamStatusDisplay = commonGameLogic.GetComponent <TeamStatusDisplay>(); ServerActionBuffer = commonGameLogic.GetComponent <ServerActionBuffer>(); TeamSelectData = commonGameLogic.GetComponent <TeamSelectData>(); BarrierManager = commonGameLogic.GetComponent <BarrierManager>(); SpawnObject <Board, Board>(MapLoader, out Board); SpawnScene(MapLoader, 2, out BrushCoordinator); SpawnScene(MapLoader, 3, out var sceneGameLogic); GameFlowData = sceneGameLogic.GetComponent <GameFlowData>(); GameplayData = sceneGameLogic.GetComponent <GameplayData>(); SpoilsManager = sceneGameLogic.GetComponent <SpoilsManager>(); ObjectivePoints = sceneGameLogic.GetComponent <ObjectivePoints>(); SpawnPointManager = sceneGameLogic.GetComponent <SpawnPointManager>(); MatchObjectiveKill = sceneGameLogic.GetComponent <MatchObjectiveKill>(); DumpNetObjects(); }
public ReportsPageModel() { if (IsInDesignMode) { ExistingActivitiesDates = new ObservableCollection <DateTime>() { DateTime.Now, DateTime.Now.AddDays(1) }; } else { ExistingActivitiesDates = BarrierManager.GetAllActivities <ObservableCollection <DateTime> >(); } }
private void RemoveBarriers(List <Barrier> barriersToRemove) { if (barriersToRemove.Count > 0) { foreach (Barrier barrier in barriersToRemove) { Log.Info($"Removing barrier by {barrier.Caster.DisplayName}"); BarrierManager.Get().RemoveBarrier(barrier); SharedEffectBarrierManager.Get().EndBarrier(barrier.m_guid); GetBarrierPayload(barrier)?.OnEnd?.Invoke(barrier); } BarrierManager.Get().CallRpcUpdateBarriers(); } }
private List <Barrier> GetJointBarriers(Barrier barrier) { uint id = barrier.BarrierSequenceSource.RootID; List <Barrier> result = new List <Barrier>(); foreach (Barrier b in BarrierManager.Get().m_barriers) { if (b.BarrierSequenceSource.RootID == id) { result.Add(b); } } return(result); }
// Start is called before the first frame update void Start() { if (ServiceLocator.Current.Get <BarrierManager>() == null) { ServiceLocator.OnServiceRegistered += (s) => { if (s is BarrierManager) { barrierManager = ServiceLocator.Current.Get <BarrierManager>(); } }; } else { barrierManager = ServiceLocator.Current.Get <BarrierManager>(); } }
private static void InitializeSpells() { IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); Q = new Spell(SpellSlot.Q, 600); Q.SetTargetted(0.25f, float.MaxValue); W = new Spell(SpellSlot.W); E = new Spell(SpellSlot.E); R = new Spell(SpellSlot.R, 400); R.SetTargetted(0.25f, float.MaxValue); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); }
public void UpdateTurn() { List <Barrier> barriersToRemove = new List <Barrier>(); foreach (Barrier barrier in BarrierManager.Get().m_barriers) { barrier.m_time.age++; if (GetBarrierPayload(barrier)?.RemoveAtTurnEnd ?? false) { Log.Info($"Barrier by {barrier.Caster.DisplayName} requested to be removed"); barriersToRemove.Add(barrier); } else if (barrier.m_time.age >= barrier.m_time.duration) { Log.Info($"Barrier by {barrier.Caster.DisplayName} expired"); barriersToRemove.Add(barrier); GetBarrierPayload(barrier)?.OnExpire?.Invoke(barrier); } } RemoveBarriers(barriersToRemove); }
private static void InitializeSpells() { IgniteManager = new IgniteManager(); BarrierManager = new BarrierManager(); Q = new Spell(SpellSlot.Q, 1000); Q.SetSkillshot(0.25f, 60, 1700, true, SkillshotType.SkillshotLine); W = new Spell(SpellSlot.W, 650); W.SetTargetted(0.1f, float.MaxValue); E = new Spell(SpellSlot.E, 800); E.SetTargetted(0.1f, float.MaxValue); R = new Spell(SpellSlot.R); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); }
private static void InitializeSpells() { igniteManager = new IgniteManager(); barrierManager = new BarrierManager(); Q = new Spell(SpellSlot.Q, 1100); Q.SetSkillshot(0.25f, 60, 1600, true, SkillshotType.SkillshotLine); W = new Spell(SpellSlot.W, 900); W.SetSkillshot(0.85f, 240, float.MaxValue, false, SkillshotType.SkillshotCircle); E = new Spell(SpellSlot.E, 650); E.SetTargetted(0.2f, float.MaxValue); R = new Spell(SpellSlot.R, 750); R.SetTargetted(0.2f, float.MaxValue); SpellList.Add(Q); SpellList.Add(W); SpellList.Add(E); SpellList.Add(R); }
public List <ClientResolutionAction> OnMovement(Dictionary <int, BoardSquarePathInfo> paths) { // sort Dictionary <int, ActorData> actorsByIndex = Utils.GetActorByIndex(); List <MovementNode> nodes = new List <MovementNode>(); foreach (var p in paths) { for (var n = p.Value; n != null; n = n.next) { actorsByIndex.TryGetValue(p.Key, out var actor); nodes.Add(new MovementNode { pathInfo = n, actor = actor }); } } nodes.Sort(); var actions = new List <ClientResolutionAction>(); var hitActorToBarrierRootIds = new Dictionary <int, HashSet <uint> >(); // storing root id because some barriers are multisegment (segments have different guids but the same root id) foreach (var node in nodes) { if (node.pathInfo.prev == null) { continue; } foreach (Barrier barrier in BarrierManager.Get().m_barriers) { if (barrier.CrossingBarrier(node.pathInfo.square.GetWorldPosition(), node.pathInfo.prev.square.GetWorldPosition())) { if (!hitActorToBarrierRootIds.ContainsKey(node.actor.ActorIndex)) { hitActorToBarrierRootIds[node.actor.ActorIndex] = new HashSet <uint>(); } if (hitActorToBarrierRootIds[node.actor.ActorIndex].Contains(barrier.BarrierSequenceSource.RootID)) { Log.Info($"{node.actor.DisplayName} hit barrier by {barrier.Caster.DisplayName} [ignoring repeated hit]"); continue; } else { Log.Info($"{node.actor.DisplayName} hit barrier by {barrier.Caster.DisplayName}"); hitActorToBarrierRootIds[node.actor.ActorIndex].Add(barrier.BarrierSequenceSource.RootID); } if (node.actor.GetTeam() != barrier.GetBarrierTeam() && barrier.m_onEnemyMovedThrough != null) { GetBarrierPayload(barrier)?.EnemyHit(barrier); var response = barrier.m_onEnemyMovedThrough; Log.Info($"{node.actor.DisplayName} hit barrier by {barrier.Caster.DisplayName}: dmg {response.m_damage}, hlg {response.m_healing}, tec {response.m_techPoints}"); var actorToHitResults = new Dictionary <ActorData, ClientActorHitResults> { { node.actor, MakeClientActorHitResults(barrier, response, node.actor) } }; actions.Add(MakeResolutionAction(node, barrier, response.m_sequenceToPlay, actorToHitResults)); OnBarrierHit(barrier, node.actor); } else if (node.actor.GetTeam() == barrier.GetBarrierTeam() && barrier.m_onAllyMovedThrough != null) { GetBarrierPayload(barrier)?.AllyHit(barrier); // TODO ally barrier hit } } } } return(actions); }
/// <summary> /// Init this game and loads all the assets needed to receive players /// </summary> public void LaunchGame() { SetGameStatus(GameStatus.Launching); MapLoader = new AssetLoader(); MapLoader.LoadAssetBundle("Bundles/scenes/maps.bundle"); MapLoader.LoadAsset($"archive:/buildplayer-robotfactory_opu_gamemode/buildplayer-{GameConfig.Map.ToLower()}"); MapLoader.ConstructCaches(); AssetsLoader = new AssetLoader(); AssetsLoader.LoadAsset("resources.assets"); AssetsLoader.ConstructCaches(); MiscLoader = new AssetLoader(); MiscLoader.LoadAssetBundle("Bundles/scenes/frontend.bundle"); MiscLoader.LoadAsset("archive:/buildplayer-options_ui/buildplayer-clientenvironmentsingletons"); MiscLoader.ConstructCaches(); SpawnObject(MiscLoader, "ApplicationSingletonsNetId", out _); SpawnObject(MiscLoader, "GameSceneSingletons", out var gameSceneSingletons); TheatricsManager = gameSceneSingletons.GetComponent <TheatricsManager>(); AbilityModManager = gameSceneSingletons.GetComponent <AbilityModManager>(); SpawnObject(MiscLoader, "SharedEffectBarrierManager", out SharedEffectBarrierManager); SpawnObject(MiscLoader, "SharedActionBuffer", out SharedActionBuffer); SharedActionBuffer.Networkm_actionPhase = ActionBufferPhase.Done; SpawnScene(MapLoader, 1, out var commonGameLogic); InterfaceManager = commonGameLogic.GetComponent <InterfaceManager>(); GameFlow = commonGameLogic.GetComponent <GameFlow>(); MatchLogger = commonGameLogic.GetComponent <MatchLogger>(); ServerCombatManager = commonGameLogic.GetComponent <ServerCombatManager>(); ServerEffectManager = commonGameLogic.GetComponent <ServerEffectManager>(); TeamStatusDisplay = commonGameLogic.GetComponent <TeamStatusDisplay>(); ServerActionBuffer = commonGameLogic.GetComponent <ServerActionBuffer>(); TeamSelectData = commonGameLogic.GetComponent <TeamSelectData>(); BarrierManager = commonGameLogic.GetComponent <BarrierManager>(); SpawnObject <Board, Board>(MapLoader, out Board); SpawnScene(MapLoader, 2, out BrushCoordinator); SpawnScene(MapLoader, 3, out var sceneGameLogic); GameFlowData = sceneGameLogic.GetComponent <GameFlowData>(); GameplayData = sceneGameLogic.GetComponent <GameplayData>(); SpoilsManager = sceneGameLogic.GetComponent <SpoilsManager>(); ObjectivePoints = sceneGameLogic.GetComponent <ObjectivePoints>(); SpawnPointManager = sceneGameLogic.GetComponent <SpawnPointManager>(); MatchObjectiveKill = sceneGameLogic.GetComponent <MatchObjectiveKill>(); PrintAllNetworkGameObjects(); foreach (LobbyPlayerInfo playerInfo in TeamInfo.TeamPlayerInfo) { // We use the ReadyState here to indicate wheter a player or bot finished loading the match if (playerInfo.IsNPCBot) { playerInfo.ReadyState = ReadyState.Ready; // Bots are marked as ready as they don't have to load anything } else { playerInfo.ReadyState = ReadyState.Unknown; // Unknown means it is loading } } SetGameStatus(GameStatus.Launched); }
public bool ResolveNextPhase() { bool lastPhase = false; TargetedActorsThisPhase = new Dictionary <ActorData, Dictionary <AbilityTooltipSymbol, int> >(); ActionsThisPhase = new List <ClientResolutionAction>(); Animations = new List <ActorAnimation>(); Barriers = new List <Barrier>(); var sab = Artemis.ArtemisServer.Get().SharedActionBuffer; if (Turn == null) { Turn = new Turn() { TurnID = GameFlowData.Get().CurrentTurn }; TargetedActorsThisTurn = new Dictionary <ActorData, Dictionary <AbilityTooltipSymbol, int> >(); ActionsThisTurn = new List <ClientResolutionAction>(); } while (ActionsThisPhase.Count == 0) { AdvancePhase(); if (Phase >= AbilityPriority.NumAbilityPriorities) { Log.Info("Abilities resolved"); lastPhase = true; break; } Log.Info($"Resolving {Phase} abilities"); foreach (ActorData actor in GameFlowData.Get().GetActors()) { GameFlowData.Get().activeOwnedActorData = actor; ResolveAbilities(actor, Phase); } GameFlowData.Get().activeOwnedActorData = null; Utils.Add(TargetedActorsThisTurn, TargetedActorsThisPhase); } sab.Networkm_abilityPhase = Phase; // TODO check this UpdateTheatricsPhase(); if (lastPhase) { Turn = null; GameFlowData.Get().activeOwnedActorData = null; sab.Networkm_actionPhase = ActionBufferPhase.AbilitiesWait; sab.Networkm_abilityPhase = AbilityPriority.Prep_Defense; Phase = AbilityPriority.INVALID; return(false); } SendToAll((short)MyMsgType.StartResolutionPhase, new StartResolutionPhase() { CurrentTurnIndex = GameFlowData.Get().CurrentTurn, CurrentAbilityPhase = Phase, NumResolutionActionsThisPhase = ActionsThisPhase.Count }); SendActions(); foreach (Barrier barrier in Barriers) { BarrierManager.Get().AddBarrier(barrier, true, out var _); // TODO AddBarrier updates ability blocking. Should we update vision/movement/cover? } // TODO process ClientResolutionManager.SendResolutionPhaseCompleted return(true); }
private void _CreateCollections() { Debug.Assert(_dataContext != null); // must be initialized // locations DataService <Location> locationDS = new DataService <Location>( _dataContext, "Locations", new SpecFields("Id", "Deleted")); _locations = new DataObjectOwnerCollection <Location, DataModel.Locations>( locationDS, false); _locations.Initialize(true, true); _locationManager = new GenericDataObjectManager <Location>( locationDS); // driver specialties _driverSpecialties = new DataObjectOwnerCollection <DriverSpecialty, DataModel.DriverSpecialties>( _dataContext, "DriverSpecialties", new SpecFields("Id", "Deleted"), false); _driverSpecialties.Initialize(true, true); // vehicle specialties _vehicleSpecialties = new DataObjectOwnerCollection <VehicleSpecialty, DataModel.VehicleSpecialties>( _dataContext, "VehicleSpecialties", new SpecFields("Id", "Deleted"), false); _vehicleSpecialties.Initialize(true, true); // mobile devices _mobileDevices = new DataObjectOwnerCollection <MobileDevice, DataModel.MobileDevices>( _dataContext, "MobileDevices", new SpecFields("Id", "Deleted"), false); _mobileDevices.Initialize(true, true); // drivers _drivers = new DataObjectOwnerCollection <Driver, DataModel.Drivers>( _dataContext, "Drivers", new SpecFields("Id", "Deleted"), false); _drivers.Initialize(true, true); // vehicles _vehicles = new DataObjectOwnerCollection <Vehicle, DataModel.Vehicles>( _dataContext, "Vehicles", new SpecFields("Id", "Deleted"), false); _vehicles.Initialize(true, true); // fuelTypes _fuelTypes = new DataObjectOwnerCollection <FuelType, DataModel.FuelTypes>( _dataContext, "FuelTypes", new SpecFields("Id", "Deleted"), false); _fuelTypes.Initialize(true, true); // route data service DataService <Route> routeDS = new DataService <Route>(_dataContext, "Routes", new SpecFields("Id")); // default routes _routesDefault = new RouteCollection(routeDS, true); var routesClause = Functional.MakeExpression((Routes route) => route.Default); _routesDefault.Initialize(routesClause, routesClause); _createScheduleScript = ResourceLoader.ReadFileAsString( CREATE_SCHEDULE_SCRIPT); _copyRoutesScript = ResourceLoader.ReadFileAsString( COPY_DEFAULT_ROUTES_FOR_SCHEDULE_SCRIPT); _copyRenewalLocationsScript = ResourceLoader.ReadFileAsString( COPY_RENEWAL_LOCATIONS_SCRIPT); // zones _zones = new DataObjectOwnerCollection <Zone, DataModel.Zones>( _dataContext, "Zones", new SpecFields("Id", "Deleted"), false); _zones.Initialize(true, true); _barrierManager = new BarrierManager(_dataContext, "Barriers", new SpecFields("Id")); _orderManager = new OrderManager(_dataContext, "Orders", new SpecFields("Id")); _scheduleManager = new ScheduleManager(_dataContext, "Schedules", new SpecFields("Id"), routeDS); }
private void Awake() { Instance = this; }