Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码面向对象 #6

Open
pixb opened this issue Aug 9, 2021 · 2 comments
Open

代码面向对象 #6

pixb opened this issue Aug 9, 2021 · 2 comments

Comments

@pixb
Copy link
Contributor

pixb commented Aug 9, 2021

大佬,看了大概的结构,也许代码结构可以优化下,让其更符合面向对象思想,尤其是更符合单一原则,这样能避免逻辑混乱,比如策略类里不要存放用户的状态,或许存放在状态类里比较好一点,策略里只放决策的算法,需要用户状态作为判断依据时,作为参数将其传入

@Yiyuan-Dong
Copy link
Owner

有道理,确实应该单独搞一个策略类。过几天应该就会更新成这样了。

@pixb
Copy link
Contributor Author

pixb commented Aug 11, 2021

看了你写的代码,一定费了不少功夫~加油哈!!
另外我更改了一个版本,在我Fork你的代码的dev分支里,有空时你可以帮忙看看,有哪些不足。我写的也不好,因为我对Python不熟,我是写java的偶尔写些c/c++。因为改动太多估计很难再合到主分支里了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants