import { Deserialize } from "../util/deserialize.model";

export class Texture2DModel implements Deserialize {
  public texture: string;

  public deserialize(raw: any): this {
    if (raw[0] !== 'Texture2D') Error('wrong type, expecting Texture2DModel, got [' + raw[0] + ']!');
    this.texture = raw[1];
    return this;
  };

  public toJSON(): object {
    return ['Texture2D', this.texture];
  }
}
