Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7188217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:01:31+00:00 2026-05-28T19:01:31+00:00

Hy, I am implementing MVC in my game and i can’t get this thing

  • 0

Hy, I am implementing MVC in my game and i can’t get this thing to work in my head. I decoupled view from game logics and controller is decoupled to. Thing actually works, but i can’t decide if Listener pattern or signals & slots is better for my case.

I have base class Entity with few pure virtual methods:

onEntityCreate //Called when new entity is allocated
onEntityDelete //Called when new entity is deallocated
onEntityBuild //Called on respawn or spawn
onEntityDispose //Called before respawn or deallocation
onEntityTick //called every tick when is entity "alive"
onEntityUpdate //called when entity position/orientation updates

i would like to run view and logics in two different threads. If i could dispatch these events at the end of logics tick to view but i don’t know how.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:01:32+00:00Added an answer on May 28, 2026 at 7:01 pm

    In my experience you should go with some hybrid Signal/Slots inside an abstract class, mainly because the Listener pattern doesn’t work very well on C++ as inner classes have zero visibility over the outer class (as in Java, per example), making the insertion of listeners a very daunting task. So, you could use the great Gallant Signals, witch is a very fast implementation of the Delegate/Signal pattern:

    class EntityProvider {
    public:
        Gallant::Signal0< Entity* > onEntityCreate;
    };
    

    and on the code you use the provider:

    void Example::bindProvider(EntityProvider* provider) {
      provider->onEntityCreate.Connect(this, &Example::onEntityCreate);
    }
    

    Also, to get a better OO design you should use a “gluer” class, that is responsible to bind/unbind classes to their providers. This is good to centralize the event management and avoid hard-to-debug problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Acctaully i am implementing Model-View-Controller(MVC) and in controller class i have to know which
I am learning WPF and implementing MVC pattern. In my controller class I am
I'm implementing a solution in ASP.NET MVC that later can be applied to couple
My question is regarding implementing MVC pattern in winforms I learned that the controller
I work on an application that uses Spring MVC and Hibernate. I am implementing
I'm still trying to understand what is the correct way of implementing MVC. This
Can I use Codeigniter classes without implementing the whole mvc pattern the same way
Is the approach for implementing substitution caching in MVC 3 contained in this page
I am implementing browser turn-based game, using javascript and asp.net MVC, probably going to
I'm trying to wrap my head around implementing MVC with as much useful abstraction

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.