Judger | Online judge sandbox based on seccomp OnlineJudge 安全沙箱 | Continuous Deployment library
kandi X-RAY | Judger Summary
kandi X-RAY | Judger Summary
Online judge sandbox based on seccomp | OnlineJudge 安全沙箱
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Judger
Judger Key Features
Judger Examples and Code Snippets
Community Discussions
Trending Discussions on Judger
QUESTION
Here is my use case. Say I have a game with two modes: CoolMode and NormalMode.
Both game modes are very different but share three common objects: Input, Score, and Judger. Each mode would have different implementations, but could be called from the main game using the same code.
...ANSWER
Answered 2020-Oct-26 at 03:13The problem is that now NormalJudger can take any Input, not just NormalInput.
If by this you mean that someone could create their own implementation of Input
and pass that to NormalJudger
, then really, you should design NormalJudger
so that it can judge any kind of Input
. Isn't that why you have created Input
as an abstract class? This is the whole point of abstraction. Judge
should not care about what specific kind of Input
it is, as long as it is an Input
. It seems like the NormalMode
type is just a "marker" for the type system to tell your types apart. Well, how about making it actually contain some data/logic, and make Judge
operate on it?
Or, you can just go the quick and dirty way, and parameterise the Judge
type differently. Rather than parameterise on the mode, parameterise on Score
and Input
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Judger
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page