Aetheria/Assets/Scripts/ServerShared/Behaviors/Switch.cs

32 lines
785 B
C#
Raw Normal View History

2026-06-13 04:56:50 +01:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
public class Switch : Behavior, IActivatedBehavior
{
public bool Activated { get; set; }
public Switch(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item)
{
}
public Switch(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item)
{
}
public override bool Execute(float dt)
{
return Activated;
}
public void Activate()
{
Activated = true;
}
public void Deactivate()
{
Activated = false;
}
}