Implement hash proc for Godot types
This commit is contained in:
parent
4eb771e9be
commit
76de026b4f
15 changed files with 139 additions and 38 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright (c) 2018 Xored Software, Inc.
|
||||
|
||||
import math
|
||||
import math, hashes
|
||||
import godotbase, godotcoretypes
|
||||
|
||||
{.push stackTrace: off.}
|
||||
|
|
@ -21,6 +21,9 @@ proc `$`*(self: Vector3): string {.inline.} =
|
|||
result.add($self.z)
|
||||
result.add(')')
|
||||
|
||||
proc hash*(self: Vector3): Hash {.inline, noinit.} =
|
||||
!$(self.x.hash() !& self.y.hash() !& self.z.hash())
|
||||
|
||||
proc `+`*(a, b: Vector3): Vector3 {.inline.} =
|
||||
result.x = a.x + b.x
|
||||
result.y = a.y + b.y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue