Community Lounge

Reply
Accepted Solution

Wonding if somebody can help with a quick error message?

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.

 

Developer of - Synesthesia Amnesia out now on Xbox Live Indie Games
http://www.youtube.com/watch?v=BTxShdti7gE
Please use plain text.

Level 2

Level 2
ProfessorOhki
Posts: 17
Registered: ‎19-04-2012
Message 2 of 4 (235 Views)

Re: Wonding if somebody can help with a quick error message?

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; }
}
}
}

 

Please use plain text.

Re: Wonding if somebody can help with a quick error message?

This worked fine thanks. Seems like the problem is with the original code i was using being created in a a newer version of c#. This is gonna be time consuming to change the whole thing.
Developer of - Synesthesia Amnesia out now on Xbox Live Indie Games
http://www.youtube.com/watch?v=BTxShdti7gE
Please use plain text.

Level 2

Level 2
ProfessorOhki
Posts: 17
Registered: ‎19-04-2012
Message 4 of 4 (214 Views)

Re: Wonding if somebody can help with a quick error message?

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...

Please use plain text.
This widget could not be displayed.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

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を一度ログアウトし、再度ログインしてください。






Recent News