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 8819099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:16:10+00:00 2026-06-14T05:16:10+00:00

Is it possible to force a static data member in inherited subclasses? Here is

  • 0

Is it possible to force a static data member in inherited subclasses?

Here is my problem/thought process:

I want to make a “GameObject’ base class that all other objects inherit from to lend to polymorphism.

I want each inherited class to have a static data member list of vertexes to render the polygons. The exact process would be:

  • Create object based on static list of vertexes
  • Apply textures
  • Rotate object based on instanced object’s rotation variables
  • Transform object based on instanced object’s world coordinates

for all objects that inherit from Game Object, I’d like to guarantee that it has the static vertex list

Should I care if it has the list or not, or should I just care that it has a draw method (guaranteed by an interface iRender)?

  • 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-06-14T05:16:11+00:00Added an answer on June 14, 2026 at 5:16 am

    If the GameObject is an interface, then you can enforce the existence of a static Property.

    interface GameObject
    {
         static List<vertex> vertices {get; set;}
         //other common code
    };
    

    Alternatively, you could just have the list of vertices as a protected data member in GameObject itself, and have the derived classes access it.

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

Sidebar

Related Questions

Possible Duplicate: Referring to a static member of a subclass Please have a look
I would like to force subclasses to implement the singleton pattern. I originally thought
Possible Duplicate: (static initialization/template instantiation) problems with factory pattern trying to force static object
Is it possible to force the iPhone to shutdown ( programmatically , of course)?
Is it possible to force the Facebook session to refresh, or alternatively, call the
I'm wondering if it is possible to force an Open/Save dialog for an inline
this may be a very simple question, but is it possible to force a
> return $this->_prepareDownloadResponse( > 'invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', > $pdf->render(), 'application/pdf' Is it still possible to force
Possible Duplicate: Javascript force open a link in a browser I am working on
Possible Duplicate: Mobile site - force landscape only / no auto-rotate I have seen

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.