.net - Access modifiers C# -


I have a class card and it has some features that get their value from the external API Is:

  Public Bull eCard {Receive. This._isCard; }} Public Balls ISSpell {Come back. This._isSpell; }} Public Bool ISMian {Receive. }} Come to the Public Bull ChristianPhone. }} Public Balls Esapower {Come back. }} Public Balls Isplelier {Come back. This._isplayer; }} Public Bull Eyesgam {Get It} }} Public Bull Ehora {get {this._isHero; }}  

So it will be like my master's class for all the cards, including weapons, spells and minions. (Of course there are more members in the actual category.)

Then I have the Minion class which comes from card ( Minion: Card) )

The problem I face is that I obviously use those members from Minion (because they are doing public) And this also does not make sense (my password is not clearly) (my password is not), so my question is: I only send those members to the card class How to keep me and for the kids?

The Personal modifier will not give me access to the second part of the library later, so I can not use it.

The problem I see is not a modifiers, it's just wrong.

It is not fully understood card object isCard is the object with property, this is the reason that IsMinion There is no meaning of the minian object on the property. Those qualities are not really related to a card object.

I suggest that it is your code to think that it is card class A enum which includes all kinds of players: < / P>

  Public Enum Cards {Minions, Weapons, Spellings, // etc ...}  

When there is something weird in your heritage hierarchy, such as a public If it is not related to property, then it is usually an indication that what you plan out of and why They do not feel OK in OOP, a lot about making the right model to fix the problem.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -