private void OnGetState(EntityUid uid, FixturesComponent component, ref ComponentGetState args) { args.State = new FixtureManagerComponentState { Fixtures = component.Fixtures.Values.ToList(), }; }
private void OnFootGetState(EntityUid uid, FootstepModifierComponent component, ref ComponentGetState args) { args.State = new FootstepModifierComponentState() { Sound = component.Sound, }; }
private void OnRiderGetState(EntityUid uid, RiderComponent component, ref ComponentGetState args) { args.State = new RiderComponentState() { Entity = component.Vehicle, }; }
private void OnParallaxGetState(EntityUid uid, ParallaxComponent component, ref ComponentGetState args) { args.State = new ParallaxComponentState { Parallax = component.Parallax }; }
private void OnRelayGetState(EntityUid uid, RelayInputMoverComponent component, ref ComponentGetState args) { args.State = new RelayInputMoverComponentState() { Entity = component.RelayEntity, }; }
private void OnGetState(EntityUid uid, RadarConsoleComponent component, ref ComponentGetState args) { args.State = new RadarConsoleComponentState() { Range = component.MaxRange }; }
private void OnGetState(EntityUid uid, FlyBySoundComponent component, ref ComponentGetState args) { args.State = new FlyBySoundComponentState() { Sound = component.Sound, Range = component.Range, }; }
private void GetCompState(EntityUid uid, AmbientSoundComponent component, ref ComponentGetState args) { args.State = new AmbientSoundComponentState { Enabled = component.Enabled, Range = component.Range, Volume = component.Volume, }; }
private void OnInjectorGetState(EntityUid uid, InjectorComponent component, ref ComponentGetState args) { _solutions.TryGetSolution(uid, InjectorComponent.SolutionName, out var solution); var currentVolume = solution?.CurrentVolume ?? FixedPoint2.Zero; var maxVolume = solution?.MaxVolume ?? FixedPoint2.Zero; args.State = new SharedInjectorComponent.InjectorComponentState(currentVolume, maxVolume, component.ToggleState); }
private void GetCompState(EntityUid uid, JointComponent component, ref ComponentGetState args) { var states = new Dictionary<string, JointState>(component.Joints.Count); foreach (var (_, joint) in component.Joints) { states.Add(joint.ID, joint.GetState()); } args.State = new JointComponent.JointComponentState(states); }
private static void OnTagGetState(EntityUid uid, TagComponent component, ref ComponentGetState args) { var tags = new string[component.Tags.Count]; var i = 0; foreach (var tag in component.Tags) { tags[i] = tag; i++; } args.State = new TagComponentState(tags); }
private void OnGetState(EntityUid uid, GunComponent component, ref ComponentGetState args) { args.State = new GunComponentState { FireRate = component.FireRate, CurrentAngle = component.CurrentAngle, MinAngle = component.MinAngle, MaxAngle = component.MaxAngle, NextFire = component.NextFire, ShotCounter = component.ShotCounter, SelectiveFire = component.SelectedMode, AvailableSelectiveFire = component.AvailableModes, }; }
private void OnPumpGetState(EntityUid uid, PumpBarrelComponent component, ref ComponentGetState args) { (int, int)? count = (component.ShotsLeft, component.Capacity); var chamberedExists = component.ChamberContainer.ContainedEntity != null; // (Is one chambered?, is the bullet spend) var chamber = (chamberedExists, false); if (chamberedExists && TryComp <AmmoComponent?>(component.ChamberContainer.ContainedEntity !.Value, out var ammo)) { chamber.Item2 = ammo.Spent; } args.State = new PumpBarrelComponentState( chamber, component.FireRateSelector, count, component.SoundGunshot.GetSound()); }
private void OnGetState(EntityUid uid, StatusEffectsComponent component, ref ComponentGetState args) { args.State = new StatusEffectsComponentState(component.ActiveEffects, component.AllowedEffects); }
private void OnStackGetState(EntityUid uid, SharedStackComponent component, ref ComponentGetState args) { args.State = new StackComponentState(component.Count, component.MaxCount); }
private void OnKnockGetState(EntityUid uid, KnockedDownComponent component, ref ComponentGetState args) { args.State = new KnockedDownComponentState(component.HelpInterval, component.HelpTimer); }
private void OnSlowGetState(EntityUid uid, SlowedDownComponent component, ref ComponentGetState args) { args.State = new SlowedDownComponentState(component.SprintSpeedModifier, component.WalkSpeedModifier); }
private void OnMultipleToolGetState(EntityUid uid, MultipleToolComponent multiple, ref ComponentGetState args) { args.State = new MultipleToolComponentState(multiple.CurrentQualityName); }
private void OnRevolverGetState(EntityUid uid, RevolverAmmoProviderComponent component, ref ComponentGetState args) { args.State = new RevolverAmmoProviderComponentState { CurrentIndex = component.CurrentIndex, AmmoSlots = component.AmmoSlots, Chambers = component.Chambers, }; }
private void OnAppearanceGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args) { args.State = new HumanoidAppearanceComponentState(component.Appearance, component.Sex, component.Gender); }
private void DamageableGetState(EntityUid uid, DamageableComponent component, ref ComponentGetState args) { args.State = new DamageableComponentState(component.Damage.DamageDict, component.DamageModifierSetId); }
private void OnRevolverGetState(EntityUid uid, RevolverBarrelComponent component, ref ComponentGetState args) { var slotsSpent = new bool?[component.Capacity]; for (var i = 0; i < component.Capacity; i++) { slotsSpent[i] = null; var ammoEntity = component.AmmoSlots[i]; if (ammoEntity != default && TryComp(ammoEntity, out AmmoComponent? ammo)) { slotsSpent[i] = ammo.Spent; } } //TODO: make yaml var to not sent currentSlot/UI? (for russian roulette) args.State = new RevolverBarrelComponentState( component.CurrentSlot, component.FireRateSelector, slotsSpent, component.SoundGunshot.GetSound()); }
private void GetState(EntityUid uid, ActionsComponent component, ref ComponentGetState args) { args.State = new ActionsComponentState(component.Actions.ToList()); }
private void OnGetState(EntityUid uid, StandingStateComponent component, ref ComponentGetState args) { args.State = new StandingComponentState(component.Standing); }
private void OnGetState(EntityUid uid, RgbLightControllerComponent component, ref ComponentGetState args) { args.State = new RgbLightControllerState(component.CycleRate, component.Layers); }
private void OnGetState(EntityUid uid, SharedAirlockComponent airlock, ref ComponentGetState args) { // Need to network airlock safety state to avoid mis-predicts when a door auto-closes as the client walks through the door. args.State = new AirlockComponentState(airlock.Safety); }
private void GetComponentState(EntityUid uid, HandsComponent hands, ref ComponentGetState args) { args.State = new HandsComponentState(hands); }
private void OnGetState(EntityUid uid, ThrownItemComponent component, ref ComponentGetState args) { args.State = new ThrownItemComponentState(component.Thrower?.Uid); }
private void OnGetState(EntityUid uid, JitteringComponent component, ref ComponentGetState args) { args.State = new JitteringComponentState(component.Amplitude, component.Frequency); }
private void GetItemSlotsState(EntityUid uid, ItemSlotsComponent component, ref ComponentGetState args) { args.State = new ItemSlotsComponentState(component.Slots); }