Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /// <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();
 }
Exemple #3
0
 public Wall(CanonicalString typeName)
     : base(typeName)
 {
     _removedTriangleIndices = new List<int>();
     _removedTriangleIndicesToSerialize = new List<int>();
     _removedTriangleIndicesOfAllTime = new List<int>();
 }
Exemple #4
0
 /// <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";
 }
Exemple #6
0
 /// <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();
 }
Exemple #7
0
 public Dock(CanonicalString typeName)
     : base(typeName)
 {
     Gravitating = false;
     _lastRepairTimes = new Dictionary<Gob, TimeSpan>();
     _repairingGobsOnClient = new List<LazyProxy<int, Gob>>();
 }
Exemple #8
0
 /// <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();
 }
Exemple #9
0
 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);
        }
Exemple #11
0
 /// <summary>
 /// Only for serialization.
 /// </summary>
 public Blink()
 {
     _blinkDistance = 500;
     _blinkMoveSpeed = 1200;
     _blinkFailTravelEffectSpeed = 2400;
     _blinkFailTravelEffect = (CanonicalString)"dummypeng";
     _blinkFailTargetEffect = (CanonicalString)"dummypeng";
 }
Exemple #12
0
 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;
     }
 }
Exemple #13
0
 /// 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";
 }
Exemple #14
0
 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);
     }
 }
Exemple #15
0
 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);
 }
Exemple #16
0
 public Ship(CanonicalString typeName)
     : base(typeName)
 {
     DampAngularVelocity = true;
 }
Exemple #17
0
 /// <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();
 }
Exemple #18
0
 public Cloak(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #19
0
 protected Weapon(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #20
0
 /// <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();
 }
Exemple #21
0
 /// <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;
 }
Exemple #22
0
 /// This constructor is only for serialisation.
 public VenomDrop()
 {
     _damageEffectTypeName = (CanonicalString)"dummygob";
 }
Exemple #23
0
 public ForwardShot(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #24
0
 public BounceBullet(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #25
0
 public ActionGob(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #26
0
 public SpawnPlayer(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #27
0
 public FloatingBullet(CanonicalString typeName)
     : base(typeName)
 {
     Gravitating = false;
 }
Exemple #28
0
 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);
 }
Exemple #29
0
 public VenomDrop(CanonicalString typeName)
     : base(typeName)
 {
 }
Exemple #30
0
 /// <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";
 }