mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Merge pull request #77 from psykzz/cleanup
Cleanup whitespace and ChatChannel summaries
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user