コード例 #1
0
		private CombatLog(IReadOnlyList<LogEntry> entries)
		{
			Entries = entries;
			var combats = new List<Combat>();

			Combat combat = null;

			foreach (var entry in Entries)
			{
				if (entry.Type == EntryType.Event && entry.Action == LogEntry.EnterCombatAction)
				{
					combat = new Combat(entry.Who);
					combats.Add(combat);
				}

				combat?.AddLogEntry(entry);

				if (entry.Type == EntryType.Event && entry.Action == LogEntry.ExitCombatAction)
					combat = null;
			}

			Combats = combats.AsReadOnly();
		}
コード例 #2
0
		public CombatViewModel(Combat combat)
		{
			Combat = combat;
		}