Skip to content
Snippets Groups Projects
Commit 66e1ef23 authored by Yann Roberge's avatar Yann Roberge
Browse files

Ajout des squelettes de classes dérivées 'bucheron' et 'excavatrice'

parent 4c116a14
No related branches found
No related tags found
No related merge requests found
-- 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
-- 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
test.lua 0 → 100644
-- 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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment