/// <summary> /// Creates a gob of the specified gob type. /// </summary> public MovingWall(CanonicalString typeName) : base(typeName) { Gravitating = false; wallModelName = (CanonicalString)"dummymodel"; startTime = new TimeSpan(-1); }
/// <summary> /// Creates an arena layer. /// </summary> /// <param name="isGameplayLayer">Is the layer the gameplay layer.</param> /// <param name="z">Depth of the layer.</param> /// <param name="parallaxName">The name of the layer's parallax, or <c>null</c>.</param> public ArenaLayer(bool isGameplayLayer, float z, string parallaxName) { _isGameplayLayer = isGameplayLayer; _z = z; _parallaxName = (CanonicalString)parallaxName; _gobs = new ArenaLayerGobCollection(); }
public Wall(CanonicalString typeName) : base(typeName) { _removedTriangleIndices = new List<int>(); _removedTriangleIndicesToSerialize = new List<int>(); _removedTriangleIndicesOfAllTime = new List<int>(); }
/// <summary> /// This constructor is only for serialisation. /// </summary> public Weapon() { _weaponInfo = new WeaponInfo(); _upgradeNames = new[] { (CanonicalString)"dummyweapontype" }; _shotTypeName = (CanonicalString)"dummygobtype"; _recoilMomentum = 10000; }
/// <summary> /// Only for serialization. /// </summary> public DamageBuffBonusAction() { _buffName = "dummy damage buff"; _bonusIconName = (CanonicalString)"dummytexture"; _damagePerSecond = 500; _pengTypeName = (CanonicalString)"dummypeng"; }
/// <summary> /// Creates a copy of an arena layer excluding its gobs. /// </summary> private ArenaLayer(ArenaLayer other) { _isGameplayLayer = other._isGameplayLayer; _z = other._z; _parallaxName = other._parallaxName; _gobs = new ArenaLayerGobCollection(); }
public Dock(CanonicalString typeName) : base(typeName) { Gravitating = false; _lastRepairTimes = new Dictionary<Gob, TimeSpan>(); _repairingGobsOnClient = new List<LazyProxy<int, Gob>>(); }
/// <summary> /// Creates an uninitialised arena layer. /// </summary> /// This constructor is only for serialisation. public ArenaLayer() { _isGameplayLayer = true; _z = 0; _parallaxName = (CanonicalString)"dummysprite"; _gobs = new ArenaLayerGobCollection(); }
public void Deserialize(NetworkBinaryReader reader, SerializationModeFlags mode, int framesAgo) { if ((mode & SerializationModeFlags.ConstantDataFromServer) != 0) { weight = reader.ReadSingle(); spawnTypeName = reader.ReadCanonicalString(); } }
private int _canonical; // set only after CanonicalString registering is disabled #endregion Fields #region Constructors static CanonicalString() { g_unregisteredCanonicalForms = new List<string>(); CanonicalForms = new List<string> { null }; g_canonicalFormsIndices = new Dictionary<string, int>(); // 'null' not added here but handled as a special case CanRegister = true; Null = new CanonicalString(null); }
/// <summary> /// Only for serialization. /// </summary> public Blink() { _blinkDistance = 500; _blinkMoveSpeed = 1200; _blinkFailTravelEffectSpeed = 2400; _blinkFailTravelEffect = (CanonicalString)"dummypeng"; _blinkFailTargetEffect = (CanonicalString)"dummypeng"; }
public override void Deserialize(NetworkBinaryReader reader, SerializationModeFlags mode, int framesAgo) { base.Deserialize(reader, mode, framesAgo); if (mode.HasFlag(SerializationModeFlags.ConstantDataFromServer)) { _propModelName = reader.ReadCanonicalString(); ModelName = _propModelName; } }
/// This constructor is only for serialisation. public Dock() { MoveType = MoveType.Static; _repairSpeed = -10; _weapon1ChargeSpeed = 100; _weapon2ChargeSpeed = 100; _repairingMoveSlowdownFactor = 0.85f; _dockIdleEffectName = (CanonicalString)"dummypeng"; _dockActiveEffectName = (CanonicalString)"dummypeng"; }
public override void Deserialize(NetworkBinaryReader reader, SerializationModeFlags mode, int framesAgo) { base.Deserialize(reader, mode, framesAgo); if ((mode & SerializationModeFlags.ConstantDataFromServer) != 0) { _wallModelName = reader.ReadCanonicalString(); var model = Game.Content.Load<Model>(_wallModelName); Effect = GetEffect(model); Texture = GetTexture(model); } }
public void SetDeviceType(ShipDevice.OwnerHandleType deviceType, CanonicalString typeName) { switch (deviceType) { case ShipDevice.OwnerHandleType.PrimaryWeapon: Weapon1Name = typeName; break; case ShipDevice.OwnerHandleType.SecondaryWeapon: Weapon2Name = typeName; break; case ShipDevice.OwnerHandleType.ExtraDevice: ExtraDeviceName = typeName; break; default: throw new ApplicationException("Unknown Weapon.OwnerHandleType " + deviceType); } var oldDevice = GetDevice(deviceType); if (oldDevice != null) Game.DataEngine.Devices.Remove(oldDevice); var newDevice = ShipDevice.Create(Game, typeName); SetDevice(deviceType, newDevice); }
public Ship(CanonicalString typeName) : base(typeName) { DampAngularVelocity = true; }
/// <summary> /// This constructor is only for serialisation. /// </summary> public Ship() { _thruster = new Thruster(); _aerodynamics = AerodynamicsType.ThrustTowardsHeading; _turnSpeed = 3; _rollMax = (float)MathHelper.PiOver4; _rollSpeed = (float)(MathHelper.TwoPi / 2.0); _weapon1TypeName = (CanonicalString)"dummyweapon"; _extraDeviceChargeMax = 5000; _extraDeviceChargeSpeed = 500; _weapon2ChargeMax = 5000; _weapon2ChargeSpeed = 500; _birthAlpha = new Curve(); _birthAlpha.PreLoop = CurveLoopType.Constant; _birthAlpha.PostLoop = CurveLoopType.Constant; for (float age = 0; age + 0.2f < 2; age += 0.4f) { _birthAlpha.Keys.Add(new CurveKey(age, 0.2f)); _birthAlpha.Keys.Add(new CurveKey(age + 0.2f, 0.8f)); } _birthAlpha.Keys.Add(new CurveKey(2, 1)); _birthAlpha.ComputeTangents(CurveTangent.Flat); _coughEngine = new CoughEngine(); }
public Cloak(CanonicalString typeName) : base(typeName) { }
protected Weapon(CanonicalString typeName) : base(typeName) { }
/// <summary> /// Creates an instance of the specified type with its TypeParameter fields /// initialized like in the template with the <paramref name="typeName"/>. /// </summary> public static Clonable Instantiate(AssaultWingCore game, CanonicalString typeName) { var template = (Clonable)game.DataEngine.GetTypeTemplate(typeName); return template.Clone(); }
/// <summary> /// Creates an instance of the specified type. /// The object's serialised fields are initialised according to the template instance /// associated with the specified type. This applies also to fields declared /// in subclasses, so a subclass constructor must not initialise its fields /// marked with <see cref="TypeDefinitionAttribute"/>. /// </summary> protected Clonable(CanonicalString typeName) { _typeName = typeName; }
/// This constructor is only for serialisation. public VenomDrop() { _damageEffectTypeName = (CanonicalString)"dummygob"; }
public ForwardShot(CanonicalString typeName) : base(typeName) { }
public BounceBullet(CanonicalString typeName) : base(typeName) { }
public ActionGob(CanonicalString typeName) : base(typeName) { }
public SpawnPlayer(CanonicalString typeName) : base(typeName) { }
public FloatingBullet(CanonicalString typeName) : base(typeName) { Gravitating = false; }
public void PrepareArenaOnClient(CanonicalString gameplayMode, string arenaName, byte arenaIDOnClient, int wallCount) { Debug.Assert(NetworkMode == Core.NetworkMode.Client); DataEngine.GameplayMode = (GameplayMode)DataEngine.GetTypeTemplate(gameplayMode); SelectedArenaName = arenaName; Logic.ShowEquipMenu(); LoadSelectedArena(arenaIDOnClient); Logic.PrepareArena(wallCount); }
public VenomDrop(CanonicalString typeName) : base(typeName) { }
/// <summary> /// For serialization only. /// In their parameterless constructors, subclasses should initialise /// all their fields marked with any limitation attribute, setting their /// values to representative defaults for XML templates. /// </summary> public Clonable() { _typeName = (CanonicalString)"unknown type"; }