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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:11:54+00:00 2026-06-13T08:11:54+00:00

I have a class that loads the drawing code for a bunch of graphics.

  • 0

I have a class that loads the drawing code for a bunch of graphics. It goes something sort of like this:

if (type == RabbitGraphic)
{
     //a whole bunch of drawing code gets loaded into an object
}
else if (type == FrogGraphic)...

This file is getting quite long with the more graphics I’ve added to it and the compilation / loading the file are taking a while. I’m wondering, is there a way I can split these graphics into separate files without having to create a new object? IE is there some mechanism I can do like:

if (type == RabbitGraphic)
{
      load file that has rabbit graphic code
}
  • 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-13T08:11:54+00:00Added an answer on June 13, 2026 at 8:11 am

    Why are you trying to avoid creating a new object? It sounds to me like more OOP is what is called for here. You should have individual classes that implement the various bits of graphics code specific to each type, optionally with a parent class that implements common functionality.

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

Sidebar

Related Questions

I have class that looks like this: class A { public: class variables_map vm
I have an AS 3.0 class that loads a JSON file in using a
I have a class that upon construction, loads it's info from a database. The
in AS3, I have an external class ImageLoader, that loads an image upon request.
i have an application that loads the page content. I use the WebClient class.
I have this class that have a function to load other classes and create
I have a class that I instantiate to save or load xml data. For
I have a class - XClass, that I want to load into an array
I'm trying to load text of all divs that have a particular class into
I have class that extend FragmentActivity in it I add fragment to layout as

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.