コード例 #1
0
 public Duck(string name, IFlyBehavior flyBehavior, IQuackBehavior quackBehavior, IWalkBehavior walkBehavior)
 {
     Name            = name ?? throw new ArgumentNullException(nameof(name));
     m_FlyBehavior   = flyBehavior ?? throw new ArgumentNullException(nameof(flyBehavior));
     m_QuackBehavior = quackBehavior ?? throw new ArgumentNullException(nameof(quackBehavior));
     m_WalkBehavior  = walkBehavior ?? throw new ArgumentNullException(nameof(walkBehavior));
 }
コード例 #2
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _follower = entity;
     _walk     = entity.GetComponent <IWalkBehavior>();
     _hasRoom  = entity.GetComponent <IHasRoom> ();
     _obj      = entity.GetComponent <ITranslateComponent> ();
 }
コード例 #3
0
		public override void Init (IEntity entity)
		{
			base.Init (entity);
            _follower = entity;
			_walk = entity.GetComponent<IWalkBehavior>();
			_hasRoom = entity.GetComponent<IHasRoom> ();
			_obj = entity.GetComponent<ITranslateComponent> ();
		}
コード例 #4
0
 public Duck(string name, IWalkBehavior wb, IFlyBehavior fb)
 {
     this.name         = name;
     this.walkBehavior = wb;
     this.flyBehvaior  = fb;
 }
コード例 #5
0
 public WildDuck(IWalkBehavior b)
 {
     this._walkbehavior = b;
 }
コード例 #6
0
 public void SetWalkBehavior(IWalkBehavior walkBehavior)
 {
     m_WalkBehavior = walkBehavior;
 }
コード例 #7
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _faceDirection = entity.GetComponent<IFaceDirectionBehavior>();
     _walk = entity.GetComponent<IWalkBehavior>();
 }
コード例 #8
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _faceDirection = entity.GetComponent <IFaceDirectionBehavior>();
     _walk          = entity.GetComponent <IWalkBehavior>();
 }
コード例 #9
0
 public Bird(string name, IFlyBehavior flyBehavior, IWalkBehavior walkBehavior)
 {
     Name         = name;
     FlyBehavior  = flyBehavior;
     WalkBehavior = walkBehavior;
 }