SaplingGrowthType() public method

public SaplingGrowthType ( int &style ) : int
style int
return int
Exemplo n.º 1
0
        public static bool SaplingGrowthType(int type, ref int saplingType, ref int style)
        {
            int     originalType  = saplingType;
            int     originalStyle = style;
            bool    flag          = false;
            ModTile modTile       = GetTile(type);

            if (modTile != null)
            {
                saplingType = modTile.SaplingGrowthType(ref style);
                if (IsSapling(saplingType))
                {
                    originalType  = saplingType;
                    originalStyle = style;
                    flag          = true;
                }
                else
                {
                    saplingType = originalType;
                    style       = originalStyle;
                }
            }
            foreach (var hook in HookSaplingGrowthType)
            {
                saplingType = hook(type, ref style);
                if (IsSapling(saplingType))
                {
                    originalType  = saplingType;
                    originalStyle = style;
                    flag          = true;
                }
                else
                {
                    saplingType = originalType;
                    style       = originalStyle;
                }
            }
            return(flag);
        }