Repository
https://github.com/RamiLego4Game/LIKO-12
New Features
- What feature(s) did you add?
I have added a package system, allowing the user to download extra programs for the fantasy computer. You can install, remove, and search packages. Each package has triggers that are ran at install, remove, enable, and disable. This allows you, for example, to move files to a specific location at install. The package system will allow there to be more features, without making the base code too big, and also it will allow there to be more specific features.
- How did you implement it/them?
It has both a program and a library. The program gets input from the user and runs functions in the library. The library, meanwhile does most of the work, reading / writing JSON files, and downloading files from the internet. The library's most important functions, that I implemented, are: - checkPackage: https://github.com/RamiLego4Game/LIKO-12/blob/d832a0470f62f82476a7db2c343086fbf23760bd/OS/DiskOS/PackagesManager/init.lua#L131 , which returns information on the package's status.
- installPackage (https://github.com/RamiLego4Game/LIKO-12/blob/d832a0470f62f82476a7db2c343086fbf23760bd/OS/DiskOS/PackagesManager/init.lua#L147) and removePackage (https://github.com/RamiLego4Game/LIKO-12/blob/d832a0470f62f82476a7db2c343086fbf23760bd/OS/DiskOS/PackagesManager/init.lua#L250) and search (https://github.com/RamiLego4Game/LIKO-12/blob/d832a0470f62f82476a7db2c343086fbf23760bd/OS/DiskOS/PackagesManager/init.lua#L282). Which do the basic functions for the program.
- And finally checkVersion, which makes sure a version meets a requirement. (https://github.com/RamiLego4Game/LIKO-12/blob/d832a0470f62f82476a7db2c343086fbf23760bd/OS/DiskOS/PackagesManager/init.lua#L231)