Esempio n. 1
0
 private void HandleExistingGateCamp(GateCamp existingGateCampByLocation, KillResult kill, StargateLocation location)
 {
     existingGateCampByLocation.Kills.Add(kill);
     if (!existingGateCampByLocation.StargateLocations.Contains(location))
     {
         existingGateCampByLocation.StargateLocations.Add(location);
     }
     existingGateCampByLocation.GateCampIndex = CalculateGateCampIndex(existingGateCampByLocation.Kills);
 }
Esempio n. 2
0
        private void BroadcastGatecampMessage(GateCamp gateCamp, GateCampMessageType gateCampMessageType)
        {
            var gateCampMessage = new GateCampMessage
            {
                GateCampMessageType = gateCampMessageType,
                GateCamp            = new GateCampMessageModel(gateCamp)
            };

            var gateCampMessageString = JsonConvert.SerializeObject(gateCampMessage);

            LOGGER.Debug("BroadcastGateCampMessage:\n" + gateCampMessageString);
            //TODO async
            GateCampsWebSocketHandler.Broadcast(gateCampMessageString);
        }
Esempio n. 3
0
        private void CreateNewGateCamp(KillResult kill, StargateLocation location)
        {
            var killResults = new List <KillResult>
            {
                kill
            };
            var gateCampIndex = CalculateGateCampIndex(killResults);
            var gateCamp      = new GateCamp
            {
                GateCampIndex     = gateCampIndex,
                StargateLocations = new List <StargateLocation>

                {
                    location
                },
                Kills = killResults
            };

            _gateCamps.Add(gateCamp);
        }
Esempio n. 4
0
 private void GateCampDifferenceDetectorOnGateCampAdded(GateCamp gateCamp)
 {
     //TODO index for gatecamps?
     BroadcastGatecampMessage(gateCamp, GateCampMessageType.ADD);
 }
Esempio n. 5
0
 private void GateCampDifferenceDetectorOnGateCampRemoved(GateCamp gateCamp)
 {
     //TODO index for gatecamps?
     BroadcastGatecampMessage(gateCamp, GateCampMessageType.REMOVE);
 }
Esempio n. 6
0
        private void GateCampDifferenceDetectorOnGateCampIndexChanged(GateCamp gateCamp)
        {
            //TODO index for gatecamps?

            BroadcastGatecampMessage(gateCamp, GateCampMessageType.CHANGE);
        }
Esempio n. 7
0
 public GateCampMessageModel(GateCamp gateCamp)
 {
     GateCampIndex     = gateCamp.GateCampIndex;
     StargateLocations = gateCamp.StargateLocations;
 }
 private void OnGateCampIndexChanged(GateCamp gatecamp)
 {
     GateCampIndexChanged?.Invoke(gatecamp);
 }
 private void OnGateCampRemoved(GateCamp gatecamp)
 {
     GateCampRemoved?.Invoke(gatecamp);
 }
 private void OnGateCampAdded(GateCamp gatecamp)
 {
     GateCampAdded?.Invoke(gatecamp);
 }