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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:33:47+00:00 2026-05-31T13:33:47+00:00

This is my class structure at the moment. The player now needs some information

  • 0

This is my class structure at the moment.

enter image description here

The player now needs some information on both the GUI and Table. How best can I do this?

  • Make the table static? (there will only ever be one table)
  • Pass an instance of the table and the corresponding seat within the constructor of player?
  • Pass the data needed for each method of players as arguments?

I would like to avoid restructuring my code to include intermediate classes or the likes if possible. At this point it would be a lot of effort. Thanks 🙂


edit:
Just to clarify as my graph is crap. The GUI contains one table instance, the table contains ten seats each seat may or may not contain a player. No inheritance has been used.

  • 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-31T13:33:48+00:00Added an answer on May 31, 2026 at 1:33 pm

    I ended up just passing the data the player needed as arguments within it’s methods. I was definitely over-thinking things as I had only a small amount of data to pass on. If the data needed is more extensive look to one of the other answers.

    This is a sample method within my table class that passes on two of it’s own variables and one of seats variables to the Player class by calling one of Players methods that needs these variables.

    seats[j].getPlayer().raise(raised, seats[j].getPosition(), inPlaySeats);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to iterate through table if it has this structure: <table> <tr> <td><input class
Can someone tell me if this class structure is bad? class abstract Parent{ public
I have a data structure that represents C# code like this: class Namespace: string
I'm creating a website with structure like this: class main { } class mysql
Okay so, I have this project structure: package A.B class SuperClass (this class is
Say you have this structure: class House < ActiveRecord::Base has_many :rooms accepts_nested_attributes_for :rooms attr_accessible
Let's say I have data structures that're something like this: Public Class AttendenceRecord Public
Given this class class Foo { // Want to find _bar with reflection [SomeAttribute]
Consider this class hierarchy: Book extends Goods Book implements Taxable As we know, there
Consider this: class User < ActiveRecord::Base # name, email, password end class Article <

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.