public AreaSyncData GetAreaSyncData(string areaId) { return(new AreaSyncData() { Area = AreaCollection.FindById(areaId), Characters = CharacterCollection.FindCharacterOnArea(areaId), Sections = SectionCollection.FindAllSectionsByArea(areaId) }); }
public void MovePlayerToArea(string characterId, string destinationAreaId) { logService.Log($"Moving character on the game state: {characterId}"); // Find Objects var character = CharacterCollection.FindById(characterId); var player = PlayerCollection.FindByPlayerName(character.PlayerName); var area = AreaCollection.FindById(destinationAreaId); // Manage area groups of hub service hubService.RemovePlayerFromAreaGroup(player.ConnectionId, character?.AreaId); hubService.AddPlayerToAreaGroup(player.ConnectionId, destinationAreaId); // Change variables character.CharacterAreaPosition = area.Position; character.AreaId = area.Id; character.AreaName = area.Name; character.movementStatus = CharacterMovementStatus.InPlace; }