core :: union_find
union–find algorithm using an efficient disjoint-set data structuregamnit :: camera_control_linux
Mouse wheel and middle mouse button to control camera
# Implementation of app.nit for the Linux platform
module linux
import app
intrude import app::app_base # For test_bound_platform
redef class App
# Path to the expected location of the asset folder of this program
#
# The asset folder should be located relative to the executable at `../assets/`.
# This value can be redefined to change the expected location.
var assets_dir: String = sys.program_name.dirname / "../assets/" is lazy
redef fun setup
do
super
on_create
on_restore_state
on_resume
end
redef fun run
do
super
on_pause
on_save_state
on_stop
end
end
redef class TextAsset
redef fun load
do
var path = app.assets_dir / path
var reader = path.to_path.open_ro
var content = reader.read_all
reader.close
var error = reader.last_error
if error != null then self.error = error
self.to_s = content
return content
end
end
redef fun bound_platform do return "GNU/Linux"
redef fun test_bound_platform do end
lib/linux/linux.nit:17,1--67,36