コード例 #1
0
        public LightSource(Game1 game, XmlTextReader reader)
            : base(game, reader)
        {
            string pxStr2      = reader.GetAttribute("px");
            string pyStr2      = reader.GetAttribute("py");
            string angleStr    = reader.GetAttribute("angle");
            string switchOnStr = reader.GetAttribute("switchOn");

            float px2 = float.Parse(pxStr2);
            float py2 = float.Parse(pyStr2);

            if (angleStr != null)
            {
                this.angle = float.Parse(angleStr);
            }
            if (switchOnStr != null && switchOnStr == "false")
            {
                this.switchOn = false;
            }

            this.game                 = game;
            this.position             = new Vector2(px2, py2);
            this.lightRay             = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
            this.lightRay.LightSource = this;
        }
コード例 #2
0
        public LightSource(Game1 game, XmlTextReader reader)
            : base(game, reader)
        {
            string pxStr2 = reader.GetAttribute("px");
            string pyStr2 = reader.GetAttribute("py");
            string angleStr = reader.GetAttribute("angle");
            string switchOnStr = reader.GetAttribute("switchOn");

            float px2 = float.Parse(pxStr2);
            float py2 = float.Parse(pyStr2);
            if (angleStr != null)
                this.angle = float.Parse(angleStr);
            if (switchOnStr != null && switchOnStr == "false")
                this.switchOn = false;

            this.game = game;
            this.position = new Vector2(px2, py2);
            this.lightRay = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
            this.lightRay.LightSource = this;
        }
コード例 #3
0
 public LightSource(Game1 game, Vector2 pos)
     : base(game, pos)
 {
     this.lightRay             = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
     this.lightRay.LightSource = this;
 }
コード例 #4
0
 public LightSource(Game1 game, Vector2 pos)
     : base(game, pos)
 {
     this.lightRay = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
     this.lightRay.LightSource = this;
 }