Esempio n. 1
0
 public override IEnumerable <Message> Handle(Model model)
 {
     if (model.FindEntity(id) == null)
     {
         yield return(new GetEntity(id));
     }
 }
Esempio n. 2
0
 public override IEnumerable<Message> Handle(Model model)
 {
     var e = model.FindEntity(id);
     if (e.Get<PushComponent>() == null)
         e.Set<PushComponent>(new PushComponent());
     e.Get<PushComponent>().Push(v);
     return null;
 }
Esempio n. 3
0
 public override System.Collections.Generic.IEnumerable<Message> Handle(Model model)
 {
     var e = model.FindEntity(id);
     if (e == null)
         yield return new GetEntity(id);
     else
         e.Get<HealthComponent>().Health += dhp;
 }
Esempio n. 4
0
 public override System.Collections.Generic.IEnumerable<Message> Handle(Model model)
 {
     var e = model.FindEntity(entityId);
     if (e == null)
         yield return new GetEntity(entityId);
     else {
         e.Get<WeaponComponent>().UpdateWeapon(weapon);
     }
 }
Esempio n. 5
0
 public override IEnumerable <Message> Handle(Model model)
 {
     if (model.FindEntity(entity.Id) != null)
     {
         return(null);
     }
     model.Add(entity);
     return(null);
 }
Esempio n. 6
0
            public override IEnumerable <Message> Handle(Model model)
            {
                var e = model.FindEntity(id);

                if (e.Get <PushComponent>() == null)
                {
                    e.Set <PushComponent>(new PushComponent());
                }
                e.Get <PushComponent>().Push(v);
                return(null);
            }
Esempio n. 7
0
            public override System.Collections.Generic.IEnumerable <Message> Handle(Model model)
            {
                var e = model.FindEntity(id);

                if (e == null)
                {
                    yield return(new GetEntity(id));
                }
                else
                {
                    e.Get <HealthComponent>().Health += dhp;
                }
            }
Esempio n. 8
0
            public override System.Collections.Generic.IEnumerable <Message> Handle(Model model)
            {
                var e = model.FindEntity(entityId);

                if (e == null)
                {
                    yield return(new GetEntity(entityId));
                }
                else
                {
                    e.Get <WeaponComponent>().UpdateWeapon(weapon);
                }
            }
Esempio n. 9
0
            public override IEnumerable <Message> Handle(Model model)
            {
                var e = model.FindEntity(entityId);

                if (e == null)
                {
                    yield return(new GetEntity(entityId));
                }
                else
                {
                    e.Set(componentName, component);
                }
            }
Esempio n. 10
0
            public override IEnumerable <Message> Handle(Model model)
            {
                var entity = model.FindEntity(id);

                if (entity != null)
                {
                    yield return(new NewEntity(entity));
                }
                else
                {
                    //throw new Exception("Entity not found!");
                }
            }