Add project files
This commit is contained in:
commit
ab339c8a2c
81 changed files with 2567 additions and 0 deletions
42
addons/godot-rapier2d/generated/updater/updater_sem_ver.gd
Normal file
42
addons/godot-rapier2d/generated/updater/updater_sem_ver.gd
Normal file
|
@ -0,0 +1,42 @@
|
|||
extends RefCounted
|
||||
|
||||
## Credits: Copied from https://github.com/MikeSchulze/gdUnit4/blob/99b7c323f443e5fcc67f9a79b4df532727e8986f/addons/gdUnit4/src/core/GdUnit4Version.gd before edits.
|
||||
|
||||
const VERSION_PATTERN = "[center][color=#9887c4]gd[/color][color=#7a57d6]Unit[/color][color=#9887c4]4[/color] [color=#9887c4]${version}[/color][/center]"
|
||||
|
||||
var _major :int
|
||||
var _minor :int
|
||||
var _patch :int
|
||||
|
||||
|
||||
func _init(major :int,minor :int,patch :int):
|
||||
_major = major
|
||||
_minor = minor
|
||||
_patch = patch
|
||||
|
||||
|
||||
static func parse(value :String):
|
||||
var regex := RegEx.new()
|
||||
regex.compile("[a-zA-Z:,-]+")
|
||||
var cleaned := regex.sub(value, "", true)
|
||||
var parts := cleaned.split(".")
|
||||
var major := parts[0].to_int()
|
||||
var minor := parts[1].to_int()
|
||||
var patch := parts[2].to_int() if parts.size() > 2 else 0
|
||||
return new(major, minor, patch)
|
||||
|
||||
|
||||
func equals(other :) -> bool:
|
||||
return _major == other._major and _minor == other._minor and _patch == other._patch
|
||||
|
||||
|
||||
func is_greater(other :) -> bool:
|
||||
if _major > other._major:
|
||||
return true
|
||||
if _major == other._major and _minor > other._minor:
|
||||
return true
|
||||
return _major == other._major and _minor == other._minor and _patch > other._patch
|
||||
|
||||
|
||||
func _to_string() -> String:
|
||||
return "v%d.%d.%d" % [_major, _minor, _patch]
|
Reference in a new issue