public static void GetPicture(Server.TokenAndId tai, int serverIndex, int pictureId, BrainDuelsLib.delegates.Action <LightImage> imageCallback) { KeyValuePair <int, int> address = new KeyValuePair <int, int>(serverIndex, pictureId); if (picturesCache.ContainsKey(address)) { imageCallback(picturesCache[address]); return; } BrainDuelsLib.delegates.Action <string> resultCallback = delegate(string s){ LightImage li = ImageSerizlizer.Deserialize(s); picturesCache[address] = li; imageCallback(li); }; PictureRequest.GetPicture(tai, serverIndex, pictureId, resultCallback); return; }
public static void GetPicture(Server.TokenAndId tai, int serverIndex, int pictureId, BrainDuelsLib.delegates.Action <string> resultCallback) { GetPictureSocketThreadedJob job = new GetPictureSocketThreadedJob(tai, serverIndex, pictureId); job.resultCallback = delegate(string s) { job.IsDone = true; job.Update(); resultCallback(s); }; job.Start(); }
public void SetEventCallback(Action <string> _callback) { this.eventCallback = _callback; }
public void SetInitGameCallback(Action <Game> _callback) { this.initGameCallback = _callback; }
public void SetOpponentMovedCallback(Action <int, string> _callback) { this.opponentMovedCallback = _callback; }
public void SetGameEndedCallback(Action <string> _callback) { this.gameEndedCallback = _callback; }
public void SetGameStateCallback(Action <string, int> _callback) { this.gameStateCallback = _callback; }
public void SetUsersCallback(BrainDuelsLib.delegates.Action <List <int> > callback) { usersCallback = callback; }
public void SetGamesCallback(BrainDuelsLib.delegates.Action <List <Game> > callback) { gamesCallback = callback; }
public void SetExpiredChallengeCallback(BrainDuelsLib.delegates.Action <int> _callback) { expiredChallengeCallback = _callback; }
public void SetCreatedChallengeCallback(BrainDuelsLib.delegates.Action <int> _callback) { createdChallengeCallback = _callback; }
public void SetToGameCallback(BrainDuelsLib.delegates.Action <Game> _callback) { toGameCallback = _callback; }
public void SetNewChallengeCallback(BrainDuelsLib.delegates.Action <int, string, string, int> _callback) { newChallengeCallback = _callback; }
public void SetRejectedChallengeCallback(BrainDuelsLib.delegates.Action <int, string, string, int> _callback) { rejectedChallengeCallback = _callback; }