コード例 #1
0
ファイル: Bomb.cs プロジェクト: fiahil/Kaboom
 /// <summary>
 /// Construct a new bomb on Z-index 10
 /// </summary>
 /// <param name="type">Pattern type</param>
 /// <param name="tile">Bomb Skin</param>
 /// <param name="highlight"> </param>
 /// <param name="orientation"> orientation of the current pattern </param>
 public Bomb(Pattern.Type type, SpriteSheet tile, string highlight = "highlight", int orientation = 0)
     : base(3, tile, EVisibility.Transparent)
 {
     Type = type;
     highlight_ = highlight;
     pattern_ = new Pattern(type, orientation);
 }
コード例 #2
0
ファイル: Pattern.cs プロジェクト: fiahil/Kaboom
        /// <summary>
        /// Try to merge two patterns. If is possible, the current pattern will be modified
        /// </summary>
        /// <param name="pattern">The pattern to merge with the object</param>
        /// <param name="temp">==== Il sert a quoi lui ? ====</param>
        /// <returns>Merge succeded or not</returns>
        public bool MergePatterns(Pattern pattern, bool temp)
        {
            var pair = new KeyValuePair<Type, Type>(this.SelectedType, pattern.SelectedType);

            if (!mergings_.ContainsKey(pair))
            {
                pair = new KeyValuePair<Type, Type>(pattern.SelectedType, this.SelectedType);
                if (!mergings_.ContainsKey(pair))
                    return false;
            }
            //if (!temp)
            SelectedType = mergings_[pair];
            this.orientation_ = pattern.orientation_;
            if (this.orientation_ >= patterns_[this.SelectedType].Count)
                this.orientation_ = 0;
            return true;
        }