From c615c0488655d37e009baa97c113d8d9bd7e454f Mon Sep 17 00:00:00 2001 From: Muukii Date: Sat, 13 Jul 2024 20:54:36 +0900 Subject: [PATCH] Patch --- Sources/VergeTypedIdentifier/EntityType.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/VergeTypedIdentifier/EntityType.swift b/Sources/VergeTypedIdentifier/EntityType.swift index 0047dec00d..84f49442c4 100644 --- a/Sources/VergeTypedIdentifier/EntityType.swift +++ b/Sources/VergeTypedIdentifier/EntityType.swift @@ -41,7 +41,7 @@ public struct EntityIdentifier : Hashable, CustomStringConve } /// A protocol describes object is an Entity. -public protocol EntityType: Equatable, Sendable { +public protocol EntityType: Identifiable, Equatable, Sendable { associatedtype EntityIDRawType: Hashable, Sendable @@ -49,3 +49,9 @@ public protocol EntityType: Equatable, Sendable { typealias EntityID = EntityIdentifier } + +extension EntityType { + public var id: EntityID { + entityID + } +}