예제 #1
0
파일: Verify.cs 프로젝트: jiowchern/Regulus
 Remoting.Value<bool> IVerify.Login(string name, string password)
 {
     Remoting.Value<bool> returnValue = new Remoting.Value<bool>(); ;
     Remoting.Value<Data.Account> val = _Storage.FindAccount(name);
     val.OnValue += (account) =>
     {
         returnValue.SetValue(_Verify(account, password));
     };
     return returnValue;
 }
예제 #2
0
        public ActorCast(Serializable.Skill skill, ActorPropertyAbility actor, Remoting.Value<CastResult> return_value)
        {
            _Actor = actor;
            this._Skill = skill;

            this._ReturnValue = return_value;
            _Done = false;
            _Machine = new Utility.StageMachine();
            _Step = CastStep.NotYet;
        }
 Regulus.Remoting.Value<IBattlerBehavior> IBattleAdmissionTickets.Visit(Pet pet)
 {
     Regulus.Remoting.Value<IBattlerBehavior> rce = new Remoting.Value<IBattlerBehavior>();
     ReadyInfomation ri = (from readyInfomation in _ReadyInfomations where readyInfomation.Battler.Id == pet.Owner && readyInfomation.Pet == null select readyInfomation).FirstOrDefault();
     if (ri != null)
     {
         ri.Pet = pet;
         ri.BattleBehavior = rce;
         _Count++;
     }
     return rce;
 }
예제 #4
0
        Remoting.Value<IBattleAdmissionTickets> IZone.Open(BattleRequester requester)
        {
            Remoting.Value<IBattleAdmissionTickets> ret = new Remoting.Value<IBattleAdmissionTickets>();

            var field = new Field(requester.Battlers.ToArray());

            field.EndEvent += () =>
            {
                _Fields.RemoveFramework(field);
            };

            field.FirstEvent += (val) =>
            {
                ret.SetValue(val);
            };
            _Fields.AddFramework(field);

            return ret;
        }
예제 #5
0
 public SkillHitToIdleBehaviorHandler(Entity entity, Remoting.Value<CastResult> result)
 {
     this._Entity = entity;
     this._Result = result;
 }
예제 #6
0
        Remoting.Value<CastResult> IActorPropertyAbility.Cast(int id)
        {
            Remoting.Value<CastResult> returnValue = new Remoting.Value<CastResult>();
            var skill = _FindSkill(id);
            if (skill != null)
            {
                _CurrentActorCast = new ActorCast(skill, this, returnValue);
                _Updater.Add(_CurrentActorCast);
            }
            else
            {
                returnValue.SetValue(CastResult.Miss);
            }

            return returnValue;
        }
예제 #7
0
 void ISessionResponse.No()
 {
     _Response.SetValue(false);
     _Response = null;
     _Binder.Unbind<ISessionResponse>(this);
 }
예제 #8
0
        internal Remoting.Value<bool> RequestOpenRoom(Remoting.Value<bool> answer)
        {
            if (_Response != null)
            {
                _Binder.Unbind<ISessionResponse>(this);
                _Response.SetValue(false);
            }

            _Binder.Bind<ISessionResponse>(this);
            _Response = answer;
            return _Response;
        }
예제 #9
0
 void ISessionResponse.Yes()
 {
     _Response.SetValue(true);
     _Response = null;
     _Binder.Unbind<ISessionResponse>(this);
 }
예제 #10
0
 private void _UnbindSessionRequester(bool obj)
 {
     _Requester = null;
 }
예제 #11
0
        internal void TeacherBusy()
        {
            _Binder.Bind<ISessionRequester>(this);

            //_Requester.SetValue(false);
            _Requester = null;
        }
예제 #12
0
 internal void NoCoin()
 {
     _Binder.Bind<ISessionRequester>(this);
     _Requester.SetValue(false);
     _Requester = null;
 }
예제 #13
0
        Remoting.Value<bool> ISessionRequester.Requester(string target, int coin)
        {
            var lession = (from l in Lession.Lessions where l.Coin <= coin orderby l.Coin descending select l).FirstOrDefault();
            if (_Requester != null)
                _Requester.SetValue(false);

            _Requester = new Remoting.Value<bool>();
            _Requester.OnValue += _UnbindSessionRequester;
            _ResuestLession = new RequestLession() { Name = target, Lession = lession.Name, Answer = _Requester };
            return _Requester;
        }