diff --git a/bucher.lua b/bucher.lua new file mode 100644 index 0000000000000000000000000000000000000000..5695cbba9318ed8d33718e08bc73a776bb1e39ad --- /dev/null +++ b/bucher.lua @@ -0,0 +1,49 @@ +-- bucher.lua +-- Created on: 2020-10-16 +-- Author: Rétro +-- +-- API d'abattage d'arbres pour tortures RSI + +--- +-- \class Bucheron RSI +local RSI_Bucheron = {} +RSI_Bucheron.__index = RSI_Bucheron + +rsiT = require("rsiTurtle") + +--- +-- \brief Constructeur de RSI_Bucheron +function RSI_Bucheron:init() + local bucheron = {} + setmetatable(bucheron,RSI_Bucheron) + + --- + -- \brief Objet parent + bucheron.base_ = rsiT:init() + + return bucheron +end + +--- +-- \brief Affiche la position et l'orientation du bucheron +function RSI_Bucheron:print() + self.base_:print() +end + +--- +-- \brief Abattre un arbre +-- \return bool Succès +function RSI_Bucheron:chopTree() + --TODO: Implementer +end + +--- +-- \brief Couper les arbres dans la zone +-- \param int nLignes Nombre de lignes +-- \param int nColonnes Nombre de colonnes +-- \return bool Succès +function RSI_Bucheron:main(nLignes, nColonnes) + --TODO: Implementer +end + +return RSI_Bucheron diff --git a/excaver.lua b/excaver.lua new file mode 100644 index 0000000000000000000000000000000000000000..b019800117238e1c2ae90740f3a7ae9cf4e6ca06 --- /dev/null +++ b/excaver.lua @@ -0,0 +1,50 @@ +-- excaver.lua +-- Created on: 2020-10-17 +-- Author: Rétro +-- +-- API d'excavation de terrain + +--- +-- \class Bucheron RSI +local RSI_Excavatrice = {} +RSI_Excavatrice.__index = RSI_Excavatrice + +rsiT = require("rsiTurtle") + +--- +-- \brief Constructeur de RSI_Bucheron +function RSI_Excavatrice:init() + local excavatrice = {} + setmetatable(excavatrice,RSI_Excavatrice) + + --- + -- \brief Objet parent + excavatrice.base_ = rsiT:init() + + return excavatrice +end + +--- +-- \brief Affiche la position et l'orientation de l'excavatrice +function RSI_Excavatrice:print() + self.base_:print() +end + +--- +-- \brief Abattre un arbre +-- \return bool Succès +--function RSI_Excavatrice:chopTree() + --TODO: Implementer +--end + +--- +-- \brief Dégager la zone vers le bas +-- \param int nLignes Nombre de lignes +-- \param int nColonnes Nombre de colonnes +-- \param int nLignes Profondeur z (vers le bas) sur laquelle excaver +-- \return bool Succès +function RSI_Excavatrice:main(nLignes, nColonnes, profondeur) + --TODO: Implementer +end + +return RSI_Excavatrice diff --git a/test.lua b/test.lua new file mode 100644 index 0000000000000000000000000000000000000000..8f991624c6130e69646e1676a8e056707d407eba --- /dev/null +++ b/test.lua @@ -0,0 +1,23 @@ +-- bucher.lua +-- Created on: 2020-10-17 +-- Author: Rétro +-- +-- Tests pour tortues RSI +-- +rsiT = require("rsiTurtle") +rsiB = require("bucher") +rsiE = require("excaver") + +rsiT.helloWorld() + +print("Test de RSI_Turtle") +t = rsiT:init() +t:print() + +print("Test de RSI_Bucheron") +b = rsiB:init() +b:print() + +print("Test de RSI_Excavatrice") +e = rsiE:init() +e:print()