Example #1
0
        public new object Clone()
        {
            IActor actor = new Actor2D("clone - " + ID,                     //deep
                                       this.ActorType,                      //deep
                                       (Transform2D)this.transform.Clone(), //deep
                                       this.StatusType);                    //deep

            //clone each of the (behavioural) controllers
            foreach (IController controller in this.ControllerList)
            {
                actor.AttachController((IController)controller.Clone());
            }

            return(actor);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            Actor2D other = obj as Actor2D;

            if (other == null)
            {
                return(false);
            }
            else if (this == other)
            {
                return(true);
            }

            return(this.Transform.Equals(other.Transform) && base.Equals(obj));
        }
        public override void Draw(GameTime gameTime)
        {
            if (!this.PauseDraw)
            {
                this.Game.SpriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

                foreach (IActor actor in this.OpaqueDrawList)
                {
                    Actor2D actor2D = actor as Actor2D;

                    if ((actor2D != null) && ((actor2D.StatusType & StatusType.Drawn) == StatusType.Drawn))
                    {
                        actor.Draw(gameTime);
                    }
                }

                this.Game.SpriteBatch.End();
            }
            base.Draw(gameTime);
        }
Example #4
0
 //call when we want to remove a drawn object from the scene
 public void Remove(Actor2D actor)
 {
     this.removeList.Add(actor);
 }
Example #5
0
 public void Add(Actor2D actor)
 {
     this.drawList.Add(actor);
 }