/// <summary> /// Creates a new action of the given type (Walk, Idle, etc.). </summary> public BasicAction(BasicActionType type) { this.type = type; // Create an animation sequence for the basic action AnimationSequence animationSequence = new AnimationSequence(); // Add an animation to the animation sequence. By default, make this the same as the type of the basic action animationSequence.animations = new string[1] { type.ToString() }; // Store the animation sequence inside this action's 'animationSequences' array base.animationSequences = new AnimationSequence[1] { new AnimationSequence() }; }
// Creates an Event with the same properties as the given event public Event(Event other) { type = other.type; actionToPerform = other.actionToPerform; basicActionToPerform = other.basicActionToPerform; soundEffect = other.soundEffect; cameraMovement = new CameraMovement(other.cameraMovement); slowMotion = other.slowMotion; particleEvent = other.particleEvent; forceEvent = new Force(other.forceEvent, false); colorFlash = other.colorFlash; ghostEffect = other.ghostEffect; screenShake = other.screenShake; tweenEvent = other.tweenEvent; startTime = other.startTime; duration = other.duration; }
public BasciAction(BasicActionType type) { _type = type; switch (_type) { case BasicActionType.Espresso: _obj = new Ingredient_Espresso_extern(); break; case BasicActionType.Filter: _obj = new Ingredient_Filter_Brew_extern(); break; case BasicActionType.Instantpower: _obj = new Ingredient_InstantPowder_extern(); break; case BasicActionType.FreshMilk: _obj = new Ingredient_Fresh_Milk_extern(); break; default: break; } }
protected void sendActionMsg(BasicActionType actionType, uint srcID, List <uint> dstID = null, List <uint> cardIDs = null, uint?actionID = null, List <uint> args = null) { Action proto = new Action() { action_type = (uint)actionType, src_id = srcID }; if (dstID != null && dstID.Count > 0) { foreach (var v in dstID) { proto.dst_ids.Add(v); } } if (cardIDs != null && cardIDs.Count > 0) { foreach (var v in cardIDs) { proto.card_ids.Add(v); } } if (actionID.HasValue) { proto.action_id = actionID.Value; if (args != null && args.Count > 0) { foreach (var v in args) { proto.args.Add(v); } } } GameManager.TCPInstance.Send(new Protobuf() { Proto = proto, ProtoID = ProtoNameIds.ACTION }); }
/// <summary> /// Returns the Action instance corresponding to the given action type. Allows external classes /// to easily access the Action instances for each basic action /// </summary> public Action GetBasicAction(BasicActionType basicAction) { // Return the action instance corresponding to the given basic action. The dictionary // maps enumeration constants to action instances. return(basicActionsDictionary[basicAction]); }
/// <summary> /// Makes this character perform the given basic action. /// </summary> public void PerformAction(BasicActionType basicAction) { // Retrieve the character's basic action from his 'actionSet' and perform the move PerformAction(actionSet.basicActions.GetBasicAction(basicAction)); }