use spaces

This commit is contained in:
Philipp 2022-08-28 23:52:19 +02:00
parent 4023b68bc9
commit cfe5f4f789
No known key found for this signature in database
GPG Key ID: 276B613AF9DBE9C3
2 changed files with 5 additions and 13 deletions

10
main.v
View File

@ -3,9 +3,9 @@ module main
import steamid as s
fn main() {
steamid := s.to_steamid32("STEAM_0:1:37792218")
assert steamid == s.SteamID32 { 0, 1, 37792218 }
assert steamid.str() == "STEAM_0:1:37792218"
assert steamid.to_steamid3() == s.SteamID3 { "U", 1, 75584437 }
assert steamid.to_steamid64() == s.SteamID64 { 76561198035850165 }
steamid := s.to_steamid32("STEAM_0:1:37792218")
assert steamid == s.SteamID32 { 0, 1, 37792218 }
assert steamid.str() == "STEAM_0:1:37792218"
assert steamid.to_steamid3() == s.SteamID3 { "U", 1, 75584437 }
assert steamid.to_steamid64() == s.SteamID64 { 76561198035850165 }
}

View File

@ -1,13 +1,5 @@
module steamid
pub fn steamid() {
steamid := to_steamid32("STEAM_0:1:37792218")
assert steamid == SteamID32 { 0, 1, 37792218 }
assert steamid.str() == "STEAM_0:1:37792218"
assert steamid.to_steamid3() == SteamID3 { "U", 1, 75584437 }
assert steamid.to_steamid64() == SteamID64 { 76561198035850165 }
}
pub fn to_steamid32(s string) SteamID32 {
if s.contains("STEAM_") && s.count(":") == 2 {
mut s_parts := s.split(":")