访问者设计模式缺少继承
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- documentation
Research direction
Open slides/design/game.md around line 1000 and review the visitor-pattern example. Update the example to show MoveMessage and JumpMessage inheriting from Message with accept methods dispatching to the corresponding visitor overloads. Done means the slide accurately demonstrates inheritance and double dispatch in C++.
Written by the indexing model from the issue text.
Description
struct MoveMessage :Message{
glm::vec3 velocityChange;
void accept(MessageVisitor *visitor) override {
visitor->visit(this); // 会调用到 visit(MoveMessage *mm) 这个重载
}
};
struct JumpMessage :Message{
double jumpHeight;
void accept(MessageVisitor *visitor) override {
visitor->visit(this); // 会调用到 visit(JumpMessage *mm) 这个重载
}
};
- Dominant language
- C++
- Stars
- 4.2k
- Forks
- 555
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from parallel101/course
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
parallel101/course#29 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
parallel101/course#39 ·
-
C++17之后才保证new一定对齐。Open
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
parallel101/course#38 ·
-
函数返回匿名结构体无法编译Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
parallel101/course#36 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
parallel101/course#34 · 1 comment ·
All issues in parallel101/course
Similar issues
-
agent:WSL bug linux LOW ui
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ArduPilot/ardupilot#34617 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tesseract-robotics/tesseract_nanobind#168 ·
Maintainers usually reply within 1 day
-
Self-hosted runner Dockerfile pins actions/runner 2.327.1, below GitHub's new minimum (2.329.0)Openauto-triaged bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/microsoft-ui-xaml#12158 ·
Maintainers usually reply within 1 day