From ac77b6cb8f2780aabccd669ed65ca1bba708c734 Mon Sep 17 00:00:00 2001 From: camille lechauve Date: Sun, 3 Sep 2023 20:03:21 +0200 Subject: [PATCH] add Disease class --- lua/autorun/server/sv_disease.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/autorun/server/sv_disease.lua diff --git a/lua/autorun/server/sv_disease.lua b/lua/autorun/server/sv_disease.lua new file mode 100644 index 0000000..3e61bb4 --- /dev/null +++ b/lua/autorun/server/sv_disease.lua @@ -0,0 +1,20 @@ +Disease = {} + +--- Disease class +---@param side name string? the name of the disease (string) +---@param side symbtoms_by_stages list? a list of list of symbtom, a list of symbtoms by stage (Symbtom) +---@param side contaminations_methods list? a list of contamination method (string) +---@param side transmissions_zone_by_stage list? a list of transmissions zone (int), one number by stage +---@param side stages_durations list? a list of stage duration (int), one number by stage +function Disease:new(name, symbtoms_by_stages, contaminations_methods, transmissions_zone_by_stages, stages_durations) + local instance = {} + setmetatable(instance, {__index = Disease}) + instance.name = name + instance.symbtoms_by_stages = symbtoms_by_stages + instance.contaminations_methods = contaminations_methods + instance.transmissions_zone_by_stages = transmissions_zone_by_stages + instance.stages_durations = stages_durations + return instance +end + +return Disease \ No newline at end of file