Exemplo n.º 1
0
 public MovableObject(BaseKeys directionKeys, Texture2D texture, Vector2 position, Rectangle?sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, float speed) : base(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth)
 {
     this.speed         = speed;
     this.rotation      = rotation;
     this.directionKeys = directionKeys;
     Game1.Updated     += Update;
     this.directionKeys.SetMe(this);
 }
Exemplo n.º 2
0
        public void Save()
        {
            var configToWrite = new ConfigFormat
            {
                BaseKeys  = BaseKeys.Select(k => k.ToString()).ToList(),
                Shortcuts = Shortcuts.Select(ps => new Shortcut
                {
                    InputKey  = ps.InputKey.ToString(),
                    OutputKey = ps.InputKey.ToString(),
                }).ToList()
            };

            SaveConfig(configToWrite);
        }