on 30-04-2012 01:24 AM
Hi folks,
I'm trying to get to grips with the PSS SDK and was first trying to port over some code i was using from my old XNA game. I got to the point where i was trying to use the old trusty GameTime gameTime menthod and remembered without the XNA tools i had to go and create my own resourse for gameTime to work.
So i tried lifting the .cs strait out of the old project which was something like:
using System;
namespace Game.Framework
{
public class GameTime
{
public GameTime();
public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime);
public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime, bool isRunningSlowly);
public TimeSpan ElapsedGameTime { get; }
public bool IsRunningSlowly { get; }
public TimeSpan TotalGameTime { get; }
}
}
The problem i am getting is errors saying "must declare a body because it is not marked abstract or extern"
is this a problem with the version of c# in monodevelop, anybody know a quick way to get round it?
any help is appreciated.
Solved! Go to Solution.
on 30-04-2012 01:44 AM
Might be a C# 3.0 vs. 2.0 thing. C# 2.0 doesn't have automatic properties. Try doing something like this:
using System;
namespace Game.Framework
{
public class GameTime
{
private TimeSpan _elapsedGameTime = SOME_DEFAULT_VALUE;
private TimeSpan _totalGameTime = SOME_DEFAULT_VALUE;
private bool _isRunningSlowly = SOME_DEFAULT_VALUE;
public GameTime();
public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime){
_totalGameTime = totalGameTime;
_elapssedGameTime= elapssedGameTime;
}
public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime, bool isRunningSlowly){
_totalGameTime = totalGameTime;
_elapssedGameTime= elapssedGameTime;
_isRunningSlowly= isRunningSlowly;
}
public TimeSpan ElapsedGameTime {
get { return _elapsedGameTime; }
set { _elapsedGameTime = elapsedGametTime; }
}
public bool IsRunningSlowly {
get { return _isRunningSlowly; }
set { _isRunningSlowly= isRunningSlowly; }
}
public TimeSpan TotalGameTime {
get { return _totalGameTime; }
set { _totalGameTime= totalGameTime; }
}
}
}
on 30-04-2012 10:19 PM
on 30-04-2012 10:52 PM
The automatic properites thing is a compiler feature, so if you can find a version of the compiler that will support it, you might not have to to refactor all your code.
Not sure if that's an easier or harder solution...
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870