Beispiel #1
0
        private void LoadEntities()
        {
            throw new NotImplementedException();
            int entitesCount     = _savedComponents.Positions.Length;
            int?firstEntityIndex = null;

            _context.ReplacePlayerEntity(_savedComponents.PlayerEntityId);
            for (int i = 0; i < entitesCount; i++)
            {
                GameEntity entity = _context.CreateEntity();
                if (!firstEntityIndex.HasValue)
                {
                    firstEntityIndex = entity.creationIndex;
                }
                int currentEntityIndex = entity.creationIndex;
                int componentIndex     = currentEntityIndex - firstEntityIndex.Value;

                IdComponent savedId = _savedComponents.Ids[componentIndex];
                entity.ReplaceId(savedId.Id);

                bool[] componentPresence = _savedComponents.EntityToHasComponent[savedId.Id];

                PositionComponent savedPosition = _savedComponents.Positions[componentIndex];
                if (componentPresence[GameComponentsLookup.Position])
                {
                    entity.AddPosition(savedPosition.Position);
                    entity.AddPositionAfterLastTurn(default(Position));
                }

                VisionComponent savedVision = _savedComponents.Visions[componentIndex];
                if (componentPresence[GameComponentsLookup.Vision])
                {
                    entity.AddVision(savedVision.VisionRange, savedVision.PerceptionRange,
                                     savedVision.EntitiesNoticed ?? new HashSet <Guid>());
                }

                RecipeeComponent savedRecipee = _savedComponents.Recipees[componentIndex];
                if (componentPresence[GameComponentsLookup.Recipee])
                {
                    entity.AddRecipee(savedRecipee.RecipeeName);
                }

                EnergyComponent savedEnergy = _savedComponents.Energies[componentIndex];
                if (componentPresence[GameComponentsLookup.Energy])
                {
                    entity.AddEnergy(savedEnergy.EnergyGainPerSegment, savedEnergy.Energy);
                }

                IntegrityComponent savedIntegrity = _savedComponents.Integrities[componentIndex];
                if (componentPresence[GameComponentsLookup.Integrity])
                {
                    entity.AddIntegrity(savedIntegrity.Integrity, savedIntegrity.MaxIntegrity);
                }

                SkillsComponent savedSkill = _savedComponents.Skills[componentIndex];
                if (componentPresence[GameComponentsLookup.Skills])
                {
                    entity.AddSkills(savedSkill.Skills);
                }

                StomachComponent savedStomach = _savedComponents.Stomachs[componentIndex];
                if (componentPresence[GameComponentsLookup.Stomach])
                {
                    entity.AddStomach(savedStomach.Satiation, savedStomach.MaxSatiation);
                }

                TeamComponent savedTeam = _savedComponents.Teams[componentIndex];
                if (componentPresence[GameComponentsLookup.Team])
                {
                    entity.AddTeam(savedTeam.Team);
                }

                LooksComponent savedLooks = _savedComponents.Looks[componentIndex];
                if (componentPresence[GameComponentsLookup.Looks])
                {
                    entity.AddLooks(savedLooks.BodySprite);
                }

                EdibleComponent savedEdible = _savedComponents.Edibles[componentIndex];
                if (componentPresence[GameComponentsLookup.Edible])
                {
                    entity.AddEdible(savedEdible.Satiety);
                }

                if (componentPresence[GameComponentsLookup.BlockingPosition])
                {
                    entity.isBlockingPosition = true;
                }

                entity.isFinishedTurn = true;
                if (_context.playerEntity.Id == entity.id.Id)
                {
                    entity.isPlayerControlled = true;
                }
            }
        }
 public RageExplosion(int cost, SkillsComponent skillsComponent, GameObject owner)
     : base(skillsComponent, owner, cost)
 {
     RadiusChecker = new RadiusProximityChecker(owner, Radius);
 }
 public SimpleBoostSkill(SkillsComponent skillsComponent, GameObject owner)
     : base(skillsComponent, owner, 5000)
 {
 }
 public AlwaysAttackingWeapon(SkillsComponent skillsComponent, GameObject owner)
     : base(skillsComponent, owner)
 {
 }
Beispiel #5
0
 public SwordWeapon(SkillsComponent skillsComponent, GameObject owner)
     : base(skillsComponent, owner)
 {
 }
Beispiel #6
0
 public RageBase(SkillsComponent skillsComponent, GameObject owner, int cost)
     : base(skillsComponent, owner)
 {
     RageCost = cost;
 }
Beispiel #7
0
 public WeaponBase(SkillsComponent skillsComponent, GameObject owner)
     : base(skillsComponent, owner)
 {
 }
Beispiel #8
0
 public BoostBase(SkillsComponent skillsComponent, GameObject owner, int cooldownMilli)
     : base(skillsComponent, owner)
 {
     CooldownTimer = TimeSpan.Zero;
     CooldownMilli = cooldownMilli;
 }