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, godotbase
|
||||
import math, godotbase, hashes
|
||||
|
||||
import internal.godotinternaltypes, internal.godotstrings
|
||||
import godotcoretypes, gdnativeapi
|
||||
|
|
@ -16,6 +16,9 @@ proc vec2*(x, y: float32): Vector2 {.inline, noinit.} =
|
|||
proc `$`*(self: Vector2): string {.inline, noinit.} =
|
||||
$getGDNativeAPI().vector2AsString(self)
|
||||
|
||||
proc hash*(self: Vector2): Hash {.inline, noinit.} =
|
||||
!$(self.x.hash() !& self.y.hash())
|
||||
|
||||
proc `+`*(self, other: Vector2): Vector2 {.inline, noinit.} =
|
||||
Vector2(x: self.x + other.x, y: self.y + other.y)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue