First commit for private source control. Older commits available on Github.

This commit is contained in:
2026-03-26 12:52:52 +00:00
parent a04c602626
commit 2d449c4a17
2176 changed files with 408185 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
using System.Collections.Generic;
using System.Linq;
using BriarQueen.Data.Identifiers;
using UnityEngine;
namespace BriarQueen.Framework.Managers.Player.Data.Codex
{
public class Codex
{
private readonly List<CodexEntrySo> _entries = new();
public IReadOnlyList<CodexEntrySo> Entries => _entries;
public void AddEntry(CodexEntrySo entry)
{
if (entry == null)
return;
if (_entries.Any(x => x.UniqueID == entry.UniqueID))
return;
Debug.Log($"Adding codex entry {entry.UniqueID}");
_entries.Add(entry);
}
public void RemoveEntry(CodexEntrySo entry)
{
if (entry == null)
return;
if (_entries.All(x => x.UniqueID != entry.UniqueID))
return;
_entries.Remove(entry);
}
public void RemoveEntry(string uniqueID)
{
var entry = _entries.FirstOrDefault(x => x.UniqueID == uniqueID);
if (entry)
_entries.Remove(entry);
}
public bool HasEntry(CodexEntrySo entry)
{
if (entry == null)
return false;
return _entries.Any(x => x.UniqueID == entry.UniqueID);
}
public bool HasEntry(string uniqueID)
{
if (string.IsNullOrWhiteSpace(uniqueID))
return false;
return _entries.Any(x => x.UniqueID == uniqueID);
}
public IEnumerable<CodexEntrySo> GetEntriesByType(CodexType codexType)
{
return _entries.Where(x => x.EntryType == codexType);
}
public IEnumerable<CodexEntrySo> GetBookEntries()
{
return GetEntriesByType(CodexType.BookEntry);
}
public IEnumerable<CodexEntrySo> GetPuzzleClues()
{
return GetEntriesByType(CodexType.PuzzleClue);
}
public IEnumerable<CodexEntrySo> GetPhotoEntries()
{
return GetEntriesByType(CodexType.Photo);
}
public void ClearEntries()
{
_entries.Clear();
}
}
}