Пример #1
0
    public void Init(MatchCardLayer layer, IDictionary <DataComposition, VisibilityConfiguration> initial, IList <DataComposition> animatingCards, IDictionary <DataComposition, float> delays, params AnimationClip[] curves)
    {
        if (this.initialized)
        {
            throw new InvalidOperationException(Constants.yz());
        }
        this.layer = new MatchCardLayer?(layer);
        this.set_Completed(false);
        this.startTime = float.NaN;
        if (delays == null)
        {
            this.delays = new Dictionary <DataComposition, float>();
        }
        else
        {
            this.delays = new Dictionary <DataComposition, float>(delays);
        }
        this.renderers = Finder.FindOrThrow <RendererManager>();
        this.renderers.Register(this);
        this.duration = 0f;
        if (initial == null || animatingCards == null || curves == null)
        {
            throw new ArgumentNullException();
        }
        if (curves.Length < 1)
        {
            throw new ArgumentException(Constants.ZA());
        }
        foreach (DataComposition dataComposition in animatingCards)
        {
            if (!initial.ContainsKey(dataComposition))
            {
                EntityComponent one = dataComposition.GetOne <EntityComponent>();
                throw new ArgumentException(string.Format(Constants.Za(), one.GetOne <NameData>().get_Name(), one.get_Parent().GetOne <NameData>().get_Name()));
            }
        }
        this.animatingCards   = new List <DataComposition>(animatingCards);
        this.curves           = curves;
        this.initialPositions = new Dictionary <DataComposition, VisibilityConfiguration>(initial);
        this.initialized      = true;
        string          text = "";
        EntityComponent deck = DataProvider.Get <HydraMatchData>().get_Entities().player.get_Deck();

        foreach (DataComposition dataComposition2 in animatingCards)
        {
            string name  = dataComposition2.GetOne <NameData>().get_Name();
            string text2 = this.ToString().Replace(" (CardPathsAnimation)", "");
            string text3 = "";
            if (text2.Substring(0, 6) == "anim_o")
            {
                text3 = "opponent";
            }
            else if (text2.Substring(0, 6) == "anim_p")
            {
                text3 = "player";
            }
            string text4 = (text3 != "") ? text2.Substring(7) : text2;
            if (text3 != "opponent" && CardPathsAnimation.draw_from_deck.Any(new Func <string, bool>(text2.Contains)))
            {
                if (text4 == "DefaultLerp" && dataComposition2.GetOne <EntityComponent>().get_Parent() == deck)
                {
                    text4 = "SummonDeck";
                    text3 = "player";
                }
                text = string.Concat(new string[]
                {
                    text,
                    (text3 != "") ? text3 : "someone",
                    " played ",
                    text4,
                    " card=",
                    dataComposition2.GetOne <NameData>().get_Name(),
                    "\n"
                });
            }
        }
        File.AppendAllText("sent.txt", text);
    }
Пример #2
0
 public void Init(MatchCardLayer layer, IDictionary <DataComposition, VisibilityConfiguration> initial, IList <DataComposition> animatingCards, params AnimationClip[] curves)
 {
     this.Init(layer, initial, animatingCards, null, curves);
 }