Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
P
PythoCup
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bold Hearts
PythoCup
Commits
c2ed95ad
Commit
c2ed95ad
authored
Dec 06, 2018
by
gem2578
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update brain to be an abstract class
parent
80048113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
brain/brain.py
brain/brain.py
+4
-2
No files found.
brain/brain.py
View file @
c2ed95ad
from
abc
import
ABC
,
abstractmethod
from
model.object_type
import
ObjectType
from
model.cup_object
import
CupObject
from
pygame.math
import
Vector2
class
Brain
():
class
Brain
(
ABC
):
def
__init__
(
self
,
side
):
self
.
side
=
side
...
...
@@ -34,5 +35,6 @@ class Brain():
objects
.
sort
(
key
=
lambda
agent
:
self
.
pos
.
distance_to
(
agent
.
pos
))
return
objects
@
abstractmethod
def
action
(
self
):
raise
Exception
(
'action() ha
ve
not been setup'
)
raise
Exception
(
'action() ha
s
not been setup'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment