示例#1
0
        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;
        }
示例#2
0
        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;
 }
示例#10
0
 public void SetExpiredChallengeCallback(BrainDuelsLib.delegates.Action <int> _callback)
 {
     expiredChallengeCallback = _callback;
 }
示例#11
0
 public void SetCreatedChallengeCallback(BrainDuelsLib.delegates.Action <int> _callback)
 {
     createdChallengeCallback = _callback;
 }
示例#12
0
 public void SetToGameCallback(BrainDuelsLib.delegates.Action <Game> _callback)
 {
     toGameCallback = _callback;
 }
示例#13
0
 public void SetNewChallengeCallback(BrainDuelsLib.delegates.Action <int, string, string, int> _callback)
 {
     newChallengeCallback = _callback;
 }
示例#14
0
 public void SetRejectedChallengeCallback(BrainDuelsLib.delegates.Action <int, string, string, int> _callback)
 {
     rejectedChallengeCallback = _callback;
 }