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); }
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); }
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); }
private void GateCampDifferenceDetectorOnGateCampAdded(GateCamp gateCamp) { //TODO index for gatecamps? BroadcastGatecampMessage(gateCamp, GateCampMessageType.ADD); }
private void GateCampDifferenceDetectorOnGateCampRemoved(GateCamp gateCamp) { //TODO index for gatecamps? BroadcastGatecampMessage(gateCamp, GateCampMessageType.REMOVE); }
private void GateCampDifferenceDetectorOnGateCampIndexChanged(GateCamp gateCamp) { //TODO index for gatecamps? BroadcastGatecampMessage(gateCamp, GateCampMessageType.CHANGE); }
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); }