User Profile

Collapse

Profile Sidebar

Collapse
DarkPhoenix739
DarkPhoenix739
Last Activity: Jan 19 '08, 04:36 AM
Joined: Jul 9 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • DarkPhoenix739
    replied to C# App: Data Hiding question
    in .NET
    I need to control read/write access at different levels, not visibility. "get and "set" do essentially this. The problem is that "get" (or sending back references to private data) essentially breaks the "private", because it gives write access to any public members of the object that you "get" (even if there is no "set" for the object). I need to make the Piece's public members read-only to anything...
    See more | Go to post

    Leave a comment:


  • DarkPhoenix739
    replied to C# App: Data Hiding question
    in .NET
    Thanks for your help.
    I considered this, but, since each piece has a lot more data than just the location, it would mean writing a new function in Game for every property I add to piece. Alternatively, if I send all the data in one function, I'm creating duplicates of all of the data, since C# doesn't have support for constant reference. Also, doing so for only one piece at a time, by index of the piece, requires the Form to know about the...
    See more | Go to post

    Leave a comment:


  • DarkPhoenix739
    started a topic C# App: Data Hiding question
    in .NET

    C# App: Data Hiding question

    I have 3 classes: a Windows Form, a Game, and a Piece. The Game has a Piece, and the Windows Form has a Game. The Windows Form needs to be able to "get" the game's Piece, and view its data, but not have access to the functions of Piece that modify that data.
    For Example:
    ..Windows Form
    .....Game
    .......Piece
    .........Locati on
    .........public location {get {return Location;} }
    .........public...
    See more | Go to post
No activity results to display
Show More
Working...