public MaterialSampler_v58(IMaterialSampler OtherSampler) : base(OtherSampler) { ID = OtherSampler.ID; SamplerStates = OtherSampler.SamplerStates; // TODO: Setup is essentially the same, maybe we can somehow make v57 and v58 share the same interface? if (OtherSampler.GetVersion() == VersionsEnumerator.V_57) { MaterialSampler_v57 CastedSampler = (OtherSampler as MaterialSampler_v57); TextureName = new HashName(CastedSampler.TextureName); TexType = CastedSampler.TexType; UnkZero = CastedSampler.UnkZero; UnkSet1 = CastedSampler.UnkSet1; UnkSet0 = new int[4]; Array.Copy(CastedSampler.UnkSet0, 0, UnkSet0, 0, 2); } else if (OtherSampler.GetVersion() == VersionsEnumerator.V_58) { MaterialSampler_v58 CastedSampler = (OtherSampler as MaterialSampler_v58); TextureName = new HashName(CastedSampler.TextureName); TexType = CastedSampler.TexType; UnkZero = CastedSampler.UnkZero; UnkSet1 = CastedSampler.UnkSet1; UnkSet0 = new int[4]; Array.Copy(CastedSampler.UnkSet0, 0, UnkSet0, 0, 2); } else { string message = string.Format("Version {0} cannot be converted from Version {1}", GetVersion(), OtherSampler.GetVersion()); Console.WriteLine(message); } }
public MaterialSampler_v63(IMaterialSampler OtherSampler) : base(OtherSampler) { if (OtherSampler.GetVersion() == VersionsEnumerator.V_63) { MaterialSampler_v63 CastedSampler = (OtherSampler as MaterialSampler_v63); Unk0 = CastedSampler.Unk0; Unk1 = CastedSampler.Unk1; } else { string message = string.Format("Version {0} cannot be converted from Version {1}", GetVersion(), OtherSampler.GetVersion()); Console.WriteLine(message); } }
public IMaterialSampler(IMaterialSampler OtherSampler) { ID = OtherSampler.ID; SamplerStates = OtherSampler.SamplerStates; }