Click here to Skip to main content
15,925,309 members
Home / Discussions / C#
   

C#

 
GeneralCasting problem Pin
bouli14-Apr-04 2:32
bouli14-Apr-04 2:32 
GeneralRe: Casting problem Pin
Heath Stewart14-Apr-04 2:39
protectorHeath Stewart14-Apr-04 2:39 
GeneralRe: Casting problem Pin
bouli14-Apr-04 2:45
bouli14-Apr-04 2:45 
GeneralRe: Casting problem Pin
Heath Stewart14-Apr-04 2:59
protectorHeath Stewart14-Apr-04 2:59 
GeneralRe: Casting problem Pin
bouli14-Apr-04 3:05
bouli14-Apr-04 3:05 
GeneralRe: Casting problem Pin
bouli14-Apr-04 3:07
bouli14-Apr-04 3:07 
GeneralRe: Casting problem Pin
Heath Stewart14-Apr-04 3:14
protectorHeath Stewart14-Apr-04 3:14 
GeneralRe: Casting problem Pin
bouli14-Apr-04 3:18
bouli14-Apr-04 3:18 
The GetRandomTetramino method selects a specialized tetramino. The code looks like this:

<br />
		private Tetramino GetRandomTetramino()<br />
		{<br />
			Random				rnd=new Random(DateTime.Now.Millisecond);<br />
			Tetramino			tetramino=null;<br />
			<br />
			TetraminoType[]		tetraminoType=(TetraminoType[]) Enum.GetValues(typeof(TetraminoType));<br />
			<br />
			switch (tetraminoType[rnd.Next(tetraminoType.Length)])<br />
			{<br />
				case TetraminoType.iTetramino:<br />
					tetramino=new ITetramino();<br />
					break;<br />
<br />
				case TetraminoType.jTetramino:<br />
					tetramino=new JTetramino();<br />
					break;<br />
				<br />
				case TetraminoType.lTetramino:<br />
					tetramino=new LTetramino();<br />
					break;<br />
				<br />
				case TetraminoType.oTetramino:<br />
					tetramino=new OTetramino();<br />
					break;<br />
<br />
				case TetraminoType.sTetramino:<br />
					tetramino=new STetramino();<br />
					break;<br />
<br />
				case TetraminoType.tTetramino:<br />
					tetramino=new TTetramino();<br />
					break;<br />
<br />
				case TetraminoType.zTetramino:<br />
					tetramino=new ZTetramino();<br />
					break;<br />
<br />
				default:<br />
					tetramino=new ITetramino();<br />
					break;<br />
			}<br />
<br />
			return tetramino;<br />
		}<br />
<br />


the shapes are correctly coded because when I do a m_tetraminoPreview.tetramino=new ITetramino for example, it shows me the correct shape.


There is no spoon.
GeneralRe: Casting problem Pin
Heath Stewart14-Apr-04 3:34
protectorHeath Stewart14-Apr-04 3:34 
GeneralRe: Casting problem Pin
bouli14-Apr-04 3:41
bouli14-Apr-04 3:41 
GeneralRe: Casting problem Pin
Heath Stewart14-Apr-04 3:47
protectorHeath Stewart14-Apr-04 3:47 
GeneralRe: Casting problem Pin
bouli14-Apr-04 3:53
bouli14-Apr-04 3:53 
Questionhow do make a column in a datagrid readonly Pin
robmays14-Apr-04 1:48
robmays14-Apr-04 1:48 
AnswerRe: how do make a column in a datagrid readonly Pin
Heath Stewart14-Apr-04 2:16
protectorHeath Stewart14-Apr-04 2:16 
GeneralRe: how do make a column in a datagrid readonly Pin
robmays14-Apr-04 2:22
robmays14-Apr-04 2:22 
GeneralRe: how do make a column in a datagrid readonly Pin
Heath Stewart14-Apr-04 2:29
protectorHeath Stewart14-Apr-04 2:29 
GeneralRe: how do make a column in a datagrid readonly Pin
robmays14-Apr-04 2:34
robmays14-Apr-04 2:34 
GeneralRe: how do make a column in a datagrid readonly Pin
Heath Stewart14-Apr-04 2:37
protectorHeath Stewart14-Apr-04 2:37 
GeneralRe: how do make a column in a datagrid readonly Pin
robmays14-Apr-04 2:39
robmays14-Apr-04 2:39 
GeneralRe: how do make a column in a datagrid readonly Pin
robmays14-Apr-04 3:59
robmays14-Apr-04 3:59 
GeneralRe: how do make a column in a datagrid readonly Pin
Heath Stewart14-Apr-04 4:12
protectorHeath Stewart14-Apr-04 4:12 
GeneralRe: how do make a column in a datagrid readonly Pin
robmays14-Apr-04 4:35
robmays14-Apr-04 4:35 
Generaltab control slow Pin
robmays14-Apr-04 1:09
robmays14-Apr-04 1:09 
GeneralRe: tab control slow Pin
Anonymous14-Apr-04 2:21
Anonymous14-Apr-04 2:21 
GeneralRe: tab control slow Pin
robmays14-Apr-04 2:25
robmays14-Apr-04 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.