In Java (And in general) is there a way to make a class so public that it's methods etc... are accessible from little classes all around that don't even instantiate it? Ha, what I mean is... If I have a daddy class that has a method draw()
and it instantiates a baby class called Hand and one called Deck, and then deck instantiates a babier class called Card that has a method play()
, is there a way for Play()
to then call Draw()
from the daddy class?
The idea here is that... the daddy class says "Deck! play(card)!" and then deck says "Card! play()!" and then play turns around and says "Hey daddy! Draw()!"
PS the idea is that... in a CCG every card has a "play()" method that is different but they are all essentially called in the same way. The opportunity to play the card comes around, and you call play on it. But the card doesn't do anything internal to itself: no no, it calls a number of methods from the rules of the game, which is has visibility to. So, like, a card in MTG that says "draw one card. Deal one damage to target player." is calling draw(player, 1) and dealDamage(player, 1) which are presumably not in the card itself... since they effect variables presumably instantiated by the players when they started the game and agreed on life totals and rules such as what "draw" means?
(meta-question: as usual, could someone please rename this question so that it reflects what I am asking... being a beginner is so frustrating!)