Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

OK, I've looked through my documentation and searched... and haven't found anything like this:

In VB, you can make property procedures with parameters:

Public Property TileData(ByVal Col As Integer, ByVal Row As Integer) As Short

Get

Return mTiles(Col, Row).Data

End Get

Set(ByVal Value As Short)

mTiles(Col, Row).Data = Value

End Set

End Property

 

Is the same possible in C# or something similar?

When I try using it, I get errors-a-plenty. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

True - but only as the default property for a class, so if you need more than one indexed property in this class, you're out of luck. But, if you just need one, you're good to go.

 

I also went through this unfortunate discovery a while back, only to find another perk that vb.net gives you.

  • Leaders
Posted

Hmm... I was afraid of that. :(

(But I did learn about indexers yay!) :)

I guess that means that I'd have to make a class for each one of these parameters that I want for arrays.

Thanks! :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...