From 8090dd2fcfb13cf89cbee4961893115f50f240c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E7=91=97=E6=9D=B0?= <3695888@qq.com> Date: Mon, 21 Dec 2020 21:59:36 +0800 Subject: [PATCH] =?UTF-8?q?P=5FC=5FM=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Game_threads/calculations.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/Game_threads/calculations.py b/libs/Game_threads/calculations.py index 329cffc..e2e7848 100644 --- a/libs/Game_threads/calculations.py +++ b/libs/Game_threads/calculations.py @@ -13,6 +13,17 @@ def P_C_M(A, B): # stand for Physics Calculation multiple A & B list format:docs.basic_config.json:basic_number """ C = [0.0, 1, [], []] + Float = A[0] * B[0] + Int = A[1] + B[1] + Unit1 = A[2].extend(B[2]) + Unit2 = [] + for unit in B[3]: + if unit in Unit1: + n = Unit1.index(unit) + Unit1.pop(n) + else: + Unit2.append(unit) + C = [Float, Int, Unit1, Unit2] return C