Search | Statistics | User Listing Forums
XNA Resources
XNA Resources ->  XNAResources.com Tutorial Forums -> Sprite Engine Series -> View Thread

You are logged in as a guest. ( logon | register )

Tutorial Number 2
Jump to page : 1
Now viewing page 1 [25 messages per page]
View previous thread :: View next thread
   XNAResources.com Tutorial Forums -> Sprite Engine SeriesMessage format
 
vallnerik
Posted 2012-03-19 12:26 AM (#428)
Subject: Tutorial Number 2


Member

Posts: 11


(68.21.102.34)
There is a error in the bottom of the tutorial number 2

public object ICloneable.Clone()
{
return new FrameAnimation(this.rectInitialFrame.X, this.rectInitialFrame.Y,
this.rectInitialFrame.Width, this.rectInitialFrame.Height,
this.iFrameCount, this.fFrameLength, sNextAnimation);
}


You don't need or rather shouldn't put the protection modifier in front ICloneable.Clone() method.

The reason for an explicit interface implementation is to avoid name collisions with the end result being that the object must be explicitly cast to that interface before calling those methods.

You can think of these methods not as being public on the class, but being tied directly to the interface. There is no reason to specify public/private/protected since it will always be public as interfaces cannot have non-public members.


http://msdn.microsoft.com/en-us/library/ms173157.aspx
Top of the page Bottom of the page
Jump to page : 1
Now viewing page 1 [25 messages per page]
Jump to forum :
Search this forum
Printer friendly version
E-mail a link to this thread

(Delete all cookies set by this site)
Running MegaBBS ASP Forum Software
© 2002-2014 PD9 Software