Example #1
0
        public override void SaveState(PluginDataWrapper pluginData)
        {
            var writer = pluginData.GetWriterForWrappedSequentialData();

            healthBar.Save(writer);
            writer.StoreNext(AttackMove);
        }
Example #2
0
File: Tower.cs Project: MK4H/MHUrho
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Building, reader);

            CreatePathfindingNodes();
        }
Example #3
0
File: Wall.cs Project: MK4H/MHUrho
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Building, reader);

            ConnectNeighbours();
        }
Example #4
0
        public override void SaveState(PluginDataWrapper pluginData)
        {
            var writer = pluginData.GetWriterForWrappedSequentialData();

            healthBar.Save(writer);
            currentState.Save(writer);
            writer.StoreNext(targetTree?.Building.ID ?? 0);
            writer.StoreNext(Cutter.Building.ID);
        }
Example #5
0
        public override void SaveState(PluginDataWrapper pluginData)
        {
            var sequential = pluginData.GetWriterForWrappedSequentialData();

            sequential.StoreNext(timeToSplit);
            sequential.StoreNext(splits);
            sequential.StoreNext(despawning);
            sequential.StoreNext(timeToDespawn);
        }
Example #6
0
        public override void SaveState(PluginDataWrapper pluginData)
        {
            var writer = pluginData.GetWriterForWrappedSequentialData();

            writer.StoreNext(FinalSize);
            writer.StoreNext(changePerSecond);
            writer.StoreNext(currentSize);
            writer.StoreNext(currentStepTimeout);
            writer.StoreNext(curSpreadTimeout);
        }
Example #7
0
        public override void SaveState(PluginDataWrapper pluginData)
        {
            var writer = pluginData.GetWriterForWrappedSequentialData();

            healthBar.Save(writer);
            foreach (var worker in workers)
            {
                worker.Store(writer);
            }
        }
Example #8
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Building, reader);

            for (int i = 0; i < numberOfWorkers; i++)
            {
                workers[i] = Worker.Load(reader, this, !Level.EditorMode);
            }
        }
Example #9
0
File: Keep.cs Project: MK4H/MHUrho
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Building, reader);


            clicker          = Building.GetDefaultComponent <Clicker>();
            clicker.Clicked += KeepClicked;
            window           = Building.Player == Level.HumanPlayer ? new KeepWindow(this) : null;

            CreatePathfindingNodes();
        }
Example #10
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            animationController = CreateAnimationController(Unit);
            walker   = Unit.GetDefaultComponent <WorldWalker>();
            attacker = Unit.GetDefaultComponent <MovingMeeleAttacker>();

            RegisterEvents();
            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Unit, reader);
            reader.GetNext(out bool attackMove);
            AttackMove = attackMove;
        }
Example #11
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            reader.GetNext(out float finalSize);
            FinalSize = finalSize;
            reader.GetNext(out changePerSecond);
            reader.GetNext(out currentSize);
            reader.GetNext(out currentStepTimeout);
            reader.GetNext(out curSpreadTimeout);

            SetSize(currentSize);
        }
Example #12
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            Unit.AlwaysVertical = true;
            animationController = Unit.CreateComponent <AnimationController>();
            Walker  = Unit.GetDefaultComponent <WorldWalker>();
            Shooter = Unit.GetDefaultComponent <Shooter>();

            RegisterEvents(Walker, Shooter, Unit.GetDefaultComponent <UnitSelector>());

            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar = HealthBarControl.Load(Level, Unit, reader);
            reader.GetNext(out bool attackMove);
            AttackMove = attackMove;
        }
Example #13
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            animationController = CreateAnimationController(Unit);
            walker = Unit.GetDefaultComponent <WorldWalker>();

            RegisterEvents(walker);

            var reader = pluginData.GetReaderForWrappedSequentialData();

            healthBar    = HealthBarControl.Load(Level, Unit, reader);
            currentState = State.Load(reader, this);
            reader.GetNext(out int treeID);
            targetTree = treeID != 0 ? (Tree)Level.GetBuilding(treeID).BuildingPlugin : null;
            reader.GetNext(out int cutterID);
            Cutter = (TreeCutter)Level.GetBuilding(cutterID).BuildingPlugin;
        }
Example #14
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            this.flier = Projectile.GetDefaultComponent <BallisticProjectile>();

            var sequential = pluginData.GetReaderForWrappedSequentialData();

            sequential.MoveNext();
            timeToSplit = sequential.GetCurrent <float>();
            sequential.MoveNext();
            splits = sequential.GetCurrent <int>();
            sequential.MoveNext();
            despawning = sequential.GetCurrent <bool>();
            sequential.MoveNext();
            timeToDespawn = sequential.GetCurrent <float>();
            sequential.MoveNext();
        }
Example #15
0
        public override void LoadState(PluginDataWrapper pluginData)
        {
            Keep = GetKeep();
            var reader = pluginData.GetReaderForWrappedSequentialData();

            cutters      = CutterWrapper.LoadCutters(reader, this, Level);
            currentState = State.Load(reader, this);

            foreach (var wolf in Player.GetUnitsOfType(type.Wolf.UnitType))
            {
                wolfs.Add(wolf, (Wolf)wolf.Plugin);
            }

            foreach (var chicken in Player.GetUnitsOfType(type.Chicken.UnitType))
            {
                chickens.Add(chicken, (Chicken)chicken.Plugin);
            }
        }
Example #16
0
File: Gate.cs Project: MK4H/MHUrho
        public override void LoadState(PluginDataWrapper pluginData)
        {
            var reader = pluginData.GetReaderForWrappedSequentialData();

            reader.GetNext(out bool isOpen);
            healthBar = HealthBarControl.Load(Level, Building, reader);

            if (isOpen)
            {
                leftDoor.SetOpen();
                rightDoor.SetOpen();
            }
            else
            {
                leftDoor.SetClosed();
                rightDoor.SetClosed();
            }

            clicker          = Building.GetDefaultComponent <Clicker>();
            clicker.Clicked += OnClicked;
            window           = new GateWindow(this);

            CreatePathfindingNodes();
        }
Example #17
0
 public override void LoadState(PluginDataWrapper pluginData)
 {
     Keep = GetKeep();
 }
Example #18
0
 public override void LoadState(PluginDataWrapper fromPluginData)
 {
     PackageUI = new PackageUI(Level.UIManager, Level, !Level.EditorMode);
 }
Example #19
0
 /// <summary>
 /// Loads instance into the state saved in <paramref name="pluginData"/>.
 ///
 /// DO NOT LOAD the default components, that is done independently by
 /// the Entity class and the components themselfs, just load your own data
 ///
 /// The default components will be loaded and present on the <see cref="IEntity.Node"/>, so you
 /// can get them by calling <see cref="IEntity.GetComponent{T}()"/>
 /// </summary>
 /// <param name="pluginData">stored state of the instance plugin</param>
 /// <returns>Instance loaded into saved state</returns>
 public abstract void LoadState(PluginDataWrapper pluginData);
Example #20
0
 public override void SaveState(PluginDataWrapper pluginData)
 {
 }
Example #21
0
 public override void LoadState(PluginDataWrapper pluginData)
 {
     this.flier = Projectile.GetDefaultComponent <BallisticProjectile>();
 }
Example #22
0
 public override void LoadState(PluginDataWrapper pluginData)
 {
 }
Example #23
0
 /// <summary>
 /// Saves the state of the plugin into <paramref name="pluginData"/>.
 ///
 /// This same <paramref name="pluginData"/> will then be provided on loading of the level to
 /// <see cref="LoadState(PluginDataWrapper)"/> method.
 /// </summary>
 /// <param name="pluginData">Data storage for the plugin data.</param>
 public abstract void SaveState(PluginDataWrapper pluginData);