看板Programming
標 題[c#]回傳型態為物件,回傳值為null
發信站夢之大地 (Sun Dec 17 13:53:17 2006)
轉信站ptt!ctu-reader!Spring!news.nctu!news2!ccnews.ncku!news.ccns.ncku!Dream
public RectangleF GetCollisionMBR()
{
//...
return bCollisionMBRExists ? rfCollisionBoundingBox : null;
} ↑ ↑
bool RectangleF
跑出錯誤
Type of conditional expression cannot be determined because there is no
implicit conversion between 'System.Drawing.RectangleF' and '<null>'
請問這裡要怎麼改?
感謝大德!
--
╮═╦═
╮╮ ╭╭═╮╭═╮╮═╦═╮╭═╮Don't hold me with your eyes.
║ ║ ║║ ║║ ║║ ║║
║ ║╠═╯The light in them I cannot see.
║ ║ ║╰═
╣╰═╣╰═╰║ ║ ║╰═╯No need to blind me.
▁║
▁ ║
▂◣ There's this darkness where I walk.
▃▄▅▆▇╰═╯╰═╯▇▆▅▆▇████▆▇▅◣ˍ ~
Playing My Game~
--
◢◣ ︵︵ █▔◣ █▔█ █▔▔ █▔█ █▆▉ █ █▔█ █◣█ █▔●
◢◤█◣◢◣ ︵︵ █ █ █▁◤ █▁▁ █▁█ ▉▉▉ █ █▁█ █◥█ █ █
夢之大地 逼逼ㄟ四 █▁◤ █ █ █▁▁ █ █ ▉▉▉ █▁ █ █ █ █ █▁◤
※ Origin: <bbs.ccns.ncku.edu.tw> ◆ From: 210.240.182.67