Merge pull request #77 from psykzz/cleanup

Cleanup whitespace and ChatChannel summaries
This commit is contained in:
Silver
2017-05-01 16:22:56 -06:00
committed by GitHub
3 changed files with 76 additions and 45 deletions

View File

@@ -19,7 +19,6 @@ namespace SS14.Client
public class GameController
{
#region Fields
private IPlayerConfigurationManager _configurationManager;
@@ -61,14 +60,11 @@ namespace SS14.Client
_stateManager = IoCManager.Resolve<IStateManager>();
_userInterfaceManager = IoCManager.Resolve<IUserInterfaceManager>();
_stateManager.RequestStateChange<MainScreen> ();
FrameEventArgs _frameEvent;
EventArgs _frameEventArgs;
_clock = new SFML.System.Clock();
while (CluwneLib.IsRunning == true)
{
@@ -260,9 +256,7 @@ namespace SS14.Client
uint displayHeight = _configurationManager.GetDisplayHeight();
bool isFullscreen = _configurationManager.GetFullscreen();
var refresh = _configurationManager.GetDisplayRefresh();
CluwneLib.Video.SetFullscreen(isFullscreen);
CluwneLib.Video.SetRefreshRate(refresh);
CluwneLib.Video.SetWindowSize(displayWidth, displayHeight);
@@ -289,14 +283,10 @@ namespace SS14.Client
CluwneLib.Screen.MouseLeft += MouseLeft;
CluwneLib.Screen.TextEntered += TextEntered;
CluwneLib.Go();
IoCManager.Resolve<IKeyBindingManager>().Initialize();
}
#endregion
#endregion

View File

@@ -287,32 +287,43 @@ namespace SS14.Server
public void Update(float frameTime)
{
if (Runlevel == RunLevel.Game)
switch (Runlevel)
{
EntityManager.ComponentManager.Update(frameTime);
EntityManager.Update(frameTime);
var start = stopWatch.ElapsedTicks;
//((AtmosManager)IoCManager.Resolve<IAtmosManager>()).Update(frameTime);
var end = stopWatch.ElapsedTicks;
var atmosTime = (end - start) / (float)Stopwatch.Frequency * 1000;
IoCManager.Resolve<IRoundManager>().CurrentGameMode.Update();
IoCManager.Resolve<ICraftingManager>().Update();
GC.KeepAlive(atmosTime);
}
else if (Runlevel == RunLevel.Lobby)
{
TimeSpan countdown = _startAt.Subtract(DateTime.Now);
if (_lastAnnounced != countdown.Seconds)
{
_lastAnnounced = countdown.Seconds;
IoCManager.Resolve<IChatManager>().SendChatMessage(ChatChannel.Server,
"Starting in " + _lastAnnounced + " seconds...",
"", 0);
}
if (countdown.Seconds <= 0)
{
StartGame();
}
case RunLevel.Game:
EntityManager.ComponentManager.Update(frameTime);
EntityManager.Update(frameTime);
var start = stopWatch.ElapsedTicks;
//((AtmosManager)IoCManager.Resolve<IAtmosManager>()).Update(frameTime);
var end = stopWatch.ElapsedTicks;
var atmosTime = (end - start) / (float)Stopwatch.Frequency * 1000;
IoCManager.Resolve<IRoundManager>().CurrentGameMode.Update();
IoCManager.Resolve<ICraftingManager>().Update();
GC.KeepAlive(atmosTime);
break;
case RunLevel.Lobby:
TimeSpan countdown = _startAt.Subtract(DateTime.Now);
if (_lastAnnounced != countdown.Seconds)
{
_lastAnnounced = countdown.Seconds;
IoCManager.Resolve<IChatManager>().SendChatMessage(ChatChannel.Server,
"Starting in " + _lastAnnounced + " seconds...",
"", 0);
}
if (countdown.Seconds <= 0)
{
StartGame();
}
break;
default:
// Unknown game state
break;
}
LastUpdate = Time;
SendGameStateUpdate();

View File

@@ -2,15 +2,45 @@
{
public enum ChatChannel
{
/// <summary>
/// Default, unspecified
/// </summary>
Default,
Lobby, // Players in the lobby chat on this channel.
Ingame, // This is local chat.
Server, // Messages from the server
Damage, // Damage messages
Player, // Messages that are sent by the player
Radio, // Radio messages
Emote, // Emotes
OOC, // Out-of-character channel
Visual, // Things the character can see
/// <summary>
/// Players in the lobby chat
/// </summary>
Lobby,
/// <summary>
/// Chat heard by players within earshot
/// </summary>
Ingame,
/// <summary>
/// Messages from the server
/// </summary>
Server,
/// <summary>
/// Damage messages
/// </summary>
Damage,
/// <summary>
/// Messages that are sent by the player directly
/// </summary>
Player,
/// <summary>
/// Radio messages
/// </summary>
Radio,
/// <summary>
/// Emotes
/// </summary>
Emote,
/// <summary>
/// Out-of-character channel
/// </summary>
OOC,
/// <summary>
/// Things the character can see
/// </summary>
Visual,
}
}