diff --git a/SuperCursor/Localizations/ruRU.csv b/SuperCursor/Localizations/ruRU.csv new file mode 100644 index 00000000..118b14ae --- /dev/null +++ b/SuperCursor/Localizations/ruRU.csv @@ -0,0 +1,17 @@ +ID,Text,Comment +"LV.SC.Nothing,""Ничего""," +"LV.SC.Stockpile,""Склад""," +"LV.SC.Coord,""Высота: {0} — (X, Y): ({1}, {2})""," +"LV.SC.Water,""Вода""," +"LV.SC.WaterDepth,"" Глубина: {0} см""," +"LV.SC.WaterDepthFrom,"" Глубина: {0} см ({1} см отсюда)""," +"LV.SC.WaterCurrent,"" Течение: {0} см³/с""," +"LV.SC.WaterContamination,"" Загрязнение: {0}%""," +"LV.SC.Dwellers,""Взрослые: {0}, Дети: {1}""," +"LV.SC.WaterSpecifiedStrength,"" Сила: {0} (обычно {1})""," +"LV.SC.WaterStrength,"" Сила: {0}""," +"LV.SC.BeaverChildGrow,""Растёт: {0}/{1} ({2}%)""," +"LV.SC.BlockStat,""Влажность: {0} блоков, Загрязнение: {1}%""," +"LV.SC.KeyBinding,""Супер курсор""," +"LV.SC.BeaverWaterConsumption,"" Вода: {0:F1} л/день""," +"LV.SC.BeaverFoodConsumption,"" Еда: {0:F1} ед/день""," diff --git a/SuperCursor/Services/ObjectDescribers/BeaverConsumptionDescriber.cs b/SuperCursor/Services/ObjectDescribers/BeaverConsumptionDescriber.cs new file mode 100644 index 00000000..3b477e94 --- /dev/null +++ b/SuperCursor/Services/ObjectDescribers/BeaverConsumptionDescriber.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuperCursor.Services.ObjectDescribers +{ + [ServicePriority(25)] + public class BeaverConsumptionDescriber( + ILoc loc +) : IObjectDescriber + { + public void Describe(StringBuilder builder, BaseComponent component) + { + if (component is not Beaver beaver) + return; + + + if (beaver.TryGetComponent(out Thirst thirst)) + { + var waterPerDay = thirst.ConsumptionRate; + builder.AppendLine(loc.T("LV.SC.BeaverWaterConsumption", waterPerDay)); + } + + if (beaver.TryGetComponent(out Hunger hunger)) + { + var foodPerDay = hunger.ConsumptionRate; + builder.AppendLine(loc.T("LV.SC.BeaverFoodConsumption", foodPerDay)); + } + } + } +}