public bool ForwardServerDataToGame(GameStateData gameStateData) { return(DataCache.Any(cache => { if (cache.LoginToken != gameStateData.LoginToken) { return false; } cache.Camera = gameStateData.Camera; cache.Images = gameStateData.Images; cache.Metadata = gameStateData.Metadata; cache.Screen = gameStateData.Screen; cache.Sounds = gameStateData.Sounds; return true; })); }
public bool ForwardClientDataToGame(GameStateUpdateData updateData) { //Console.WriteLine("Forwarding client info to server..."); return(DataCache.Any(cache => { if (cache.LoginToken != updateData.LoginToken) { return false; } cache.Commands = updateData.Commands ?? new List <string>(); if (updateData.Screen != null) { cache.Screen = updateData.Screen; } return true; })); }