From d37cd7b41c65ffc48e0c20d9008d450781275666 Mon Sep 17 00:00:00 2001 From: ehermakov Date: Sun, 23 Jun 2024 19:51:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=B3=D0=B5=D0=B9?= =?UTF-8?q?=D0=BC=20=D0=B0=D0=BF=D0=B4=D0=B5=D0=B9=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShipCraft/Переделка/ShipField.py | 13 ++++++---- .../__pycache__/ShipField.cpython-311.pyc | Bin 14620 -> 14568 bytes HNS/Excercises/ShipCraft/Переделка/main.py | 23 +++++++++++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/HNS/Excercises/ShipCraft/Переделка/ShipField.py b/HNS/Excercises/ShipCraft/Переделка/ShipField.py index d4442c8..0501ff8 100644 --- a/HNS/Excercises/ShipCraft/Переделка/ShipField.py +++ b/HNS/Excercises/ShipCraft/Переделка/ShipField.py @@ -241,11 +241,14 @@ class ShipField: else: self.ship_direction = ShipDirection.VERTICAL - def toggle_field_mode(self): - if self.field_mode == ShipMode.PUT: - self.field_mode = ShipMode.SHOOT - else: - self.field_mode = ShipMode.PUT + def set_field_mode(self, value): + if value is None: + return + + if type(value) is not ShipMode: + return + + self.field_mode = value def print_field(self): print(self.ships) diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc index 4ed20c507347260c8e0c67551a31fca2217ea375..e74b867f0f6b06e291e8641bff487b467757d83b 100644 GIT binary patch delta 288 zcmbPJ^rDb=IWI340}%WPtVlE5$opS^@^W2KMxV)hb?xhG7~+{gav+ex5X?}d0c2=0 z7bya%B32L~1R`R9L@`LAfsHj+G*WmEipIa0=F6vfrTGP$#<~y@OJ>=W*x&>OpJdw wA2-%#V&vTX-Bf^ypPg0V0|T58nk;5<+}@pqQR)K&cJd=w{0k1*A}OGw0CFBn;{X5v delta 270 zcmaD+IH!nrIWI340}#}?SELzjP zA_*XQORywAJv}EiJ}omfCnY{NKP9zFIyfV5M$>D(UHvce~#l-k)^JHUvCPuc+hfM{T_*q!BKQO=v dp2?5QkK4PjFiL%3z)pSyi+{l(TO