public static IParticleFactory ReadParticleFactory(this NetIncomingMessage msg) { IParticleFactory f = null; int hash = msg.ReadInt32(); if (hash == typeof(ParticleSphereFactory).GUID.GetHashCode()) { f = new ParticleSphereFactory(); } else if (hash == typeof(ParticleImageFactory).GUID.GetHashCode()) { f = new ParticleImageFactory(); } else if (hash == typeof(ParticleSmokeFactory).GUID.GetHashCode()) { f = new ParticleSmokeFactory(); } else if (hash == typeof(BaseParticleFactory).GUID.GetHashCode()) { f = new BaseParticleFactory(); } else { Logger.Error("Reading unsupported factory! Hash " + hash); } Logger.Warn("Reading particle factory (" + f.GetType().Name + ") hash " + hash); f.ReadObject(msg); return(f); }
public static ParticleEmmitor CreateBasicDebris(SceneMgr mgr, Color color) { ParticleEmmitor e = new ParticleEmmitor(mgr, IdMgr.GetNewId(0)); BaseParticleFactory f = new BaseParticleFactory(); f.Color = color; e.Factory = f; return(e); }