コード例 #1
0
    public static List <eCardId> GetDeckList(eDeckType type, eCardFaction faction)
    {
        List <eCardId> lst = GetDeckList(type);

        lst.RemoveAll(x => Card.GetFactionOf(x) != faction);
        return(lst);
    }
コード例 #2
0
        ETABSProperty2D Property2DToSpeckle(string area, string property)
        {
            eAreaDesignOrientation areaDesignOrientation = eAreaDesignOrientation.Null;

            Model.AreaObj.GetDesignOrientation(area, ref areaDesignOrientation);
            eDeckType     deckType     = eDeckType.Filled;
            eSlabType     slabType     = eSlabType.Drop;
            eWallPropType wallPropType = eWallPropType.Specified;
            eShellType    shellType    = eShellType.Layered;
            string        matProp      = "";
            double        thickness    = 0;
            int           color        = 0;
            string        notes        = "";
            string        GUID         = "";

            switch (areaDesignOrientation)
            {
            case eAreaDesignOrientation.Wall:
                return(WallPropertyToSpeckle(property));

                break;

            case eAreaDesignOrientation.Floor:
                return(FloorPropertyToSpeckle(property));

                break;
            }

            double[] value = null;

            return(null);
        }
コード例 #3
0
 public void SetDeck(string name,
                     double thickness,
                     eDeckType deckType,
                     eShellType shellType,
                     string nameMaterial,
                     int color    = -1,
                     string notes = "",
                     string GUID  = "")
 {
 }
コード例 #4
0
 public void GetDeck(string name,
                     ref double thickness,
                     ref eDeckType deckType,
                     ref eShellType shellType,
                     ref string nameMaterial,
                     ref int color,
                     ref string notes,
                     ref string GUID)
 {
 }
コード例 #5
0
 public Deck(eDeckType deckType)
 {
     this.deckType = deckType;
     _discard      = new List <Card>((int)deckType);
     if (_randomInitialized == false)
     {
         Random.InitState(System.DateTime.Now.Millisecond);
         _randomInitialized = true;
     }
     _deck = CreateDeck(deckType);
     Shuffle();
 }
コード例 #6
0
    private static List <Card> CreateDeck(eDeckType deckType)
    {
        List <Card> deck = new List <Card>((int)deckType);

        //int j = 0;
        foreach (eCardId id in Deck.GetDeckList(deckType))
        {
            deck.Add(new Card(id));
            //  Debug.Log(++j + " "+ id);
        }
        return(deck);
    }
コード例 #7
0
ファイル: Deck.cs プロジェクト: V01dPr0xy/Scrum_Card_Games
    public void Build(eDeckType type = eDeckType.STANDARD, List <int> included = null)
    {
        m_cards = new List <Card>();

        switch (type)
        {
        case eDeckType.STANDARD:
            for (int i = 0; i < m_cardValues.Length; i++)
            {
                GameObject go   = Instantiate(m_cardBase, gameObject.transform);
                Card       card = go.GetComponent <Card>();

                if (card)
                {
                    card.Initialize((eValues)m_cardValues[i], m_cardImages[i], m_cardBack);

                    m_cards.Add(card);
                }
            }
            break;

        case eDeckType.FULL:
            for (int i = 0; i < 52; i++)
            {
                GameObject go   = Instantiate(m_cardBase);
                Card       card = go.GetComponent <Card>();

                if (card)
                {
                    card.Initialize((eValues)i, m_cardImages[i], m_cardBack);

                    m_cards.Add(card);
                }
            }
            break;

        case eDeckType.CUSTOM:
            for (int i = 0; i < included.Count; i++)
            {
                GameObject go   = Instantiate(m_cardBase);
                Card       card = go.GetComponent <Card>();

                if (card)
                {
                    card.Initialize((eValues)i, m_cardImages[i], m_cardBack);

                    m_cards.Add(card);
                }
            }
            break;
        }
    }
コード例 #8
0
    ////////////////////////////////////////////////////////////////
    override public bool Init(MenuParams parms)
    {
        is_regist = parms.GetObject <bool>("is_regist");

        string deck_type = parms.GetObject("deck_type") as string;

        if (deck_type != null && deck_type == "defense")
        {
            m_DeckType = eDeckType.Defense;
            var team_data = TeamDataManager.Instance.GetTeam(pe_Team.PVP_Defense);
            if (team_data == null)
            {
                m_CurrentTeam = new TeamData(pe_Team.PVP_Defense, null);
            }
            else
            {
                m_CurrentTeam = team_data.Clone();
            }
        }
        else
        {
            m_DeckType = eDeckType.Offense;
            var team_data = TeamDataManager.Instance.GetTeam(pe_Team.PVP);
            if (team_data == null)
            {
                m_CurrentTeam = new TeamData(pe_Team.PVP, null);
            }
            else
            {
                m_CurrentTeam = team_data.Clone();
            }

            foreach (var team_creature in Network.PVPBattleInfo.enemy_team_data.Creatures)
            {
                DungeonMonster enemy = DungeonMonsterManager.GetNewObject <DungeonMonster>(m_GridEnemyHeroes.transform, Vector3.zero);
                enemy.Init(team_creature.creature);
            }
            m_GridEnemyHeroes.Reposition();
        }

        m_ToggleOffenseTeam.value = m_DeckType == eDeckType.Offense;

        toggle_menus[0].value = true;
        InitHeroesItem();
        Init();
        return(true);
    }
コード例 #9
0
    public static List <eCardId> GetDeckList(eDeckType type)
    {
        if (_lstDeck32 == null || _lstDeck54 == null || _lstDeck52 == null)
        {
            InitializeLists();
        }
        switch (type)
        {
        case eDeckType.std32Card:
            return(new List <eCardId>(_lstDeck32));

        case eDeckType.std52Card:
            return(new List <eCardId>(_lstDeck52));

        case eDeckType.std54Card:
            return(new List <eCardId>(_lstDeck54));

        default:
            return(null);
        }
    }
コード例 #10
0
        GetDeck(this cPropArea obj, string Name)
        {
            eDeckType DeckType;

            DeckType = default(eDeckType);
            eShellType ShellType;

            ShellType = default(eShellType);
            string MatProp, notes, GUID;

            MatProp = notes = GUID = default(string);
            double Thickness;

            Thickness = default(double);
            int color;

            color = default(int);
            var res = obj.GetDeck(Name, ref DeckType, ref ShellType, ref MatProp, ref Thickness, ref color, ref notes, ref GUID);

            return(DeckType, ShellType, MatProp, Thickness, color, notes, GUID);
        }
コード例 #11
0
        public ETABSProperty2D FloorPropertyToSpeckle(string property)
        {
            eDeckType  deckType  = eDeckType.Filled;
            eSlabType  slabType  = eSlabType.Drop;
            eShellType shellType = eShellType.Layered;
            string     matProp   = "";
            double     thickness = 0;
            int        color     = 0;
            string     notes     = "";
            string     GUID      = "";

            int d = Model.PropArea.GetDeck(property, ref deckType, ref shellType, ref matProp, ref thickness, ref color, ref notes, ref GUID);

            if (d == 0)
            {
                var    speckleProperties2D = new ETABSProperty2D();
                double slabDepth           = 0;
                double shearStudDia        = 0;
                double shearStudFu         = 0;
                double shearStudHt         = 0;
                double ribDepth            = 0;
                double ribWidthTop         = 0;
                double ribWidthBot         = 0;
                double ribSpacing          = 0;
                double shearThickness      = 0;
                double unitWeight          = 0;
                var    speckleShellType    = ConvertShellType(shellType);
                if (deckType == eDeckType.Filled)
                {
                    var speckleProperty2D = new ETABSProperty2D.DeckFilled();
                    Model.PropArea.GetDeckFilled(property,
                                                 ref slabDepth,
                                                 ref ribDepth,
                                                 ref ribWidthTop,
                                                 ref ribWidthBot,
                                                 ref ribSpacing,
                                                 ref shearThickness,
                                                 ref unitWeight,
                                                 ref shearStudDia,
                                                 ref shearStudHt,
                                                 ref shearStudFu);
                    speckleProperty2D.SlabDepth      = slabDepth;
                    speckleProperty2D.ShearStudDia   = shearStudDia;
                    speckleProperty2D.ShearStudFu    = shearStudFu;
                    speckleProperty2D.RibDepth       = ribDepth;
                    speckleProperty2D.RibWidthTop    = ribWidthTop;
                    speckleProperty2D.RibWidthBot    = ribWidthBot;
                    speckleProperty2D.RibSpacing     = ribSpacing;
                    speckleProperty2D.ShearThickness = shearThickness;
                    speckleProperty2D.UnitWeight     = unitWeight;
                    speckleProperty2D.ShearStudHt    = shearStudHt;
                    speckleProperty2D.deckType       = Structural.ETABS.Analysis.DeckType.Filled;
                    setProperties(speckleProperty2D, matProp, thickness, property);
                    speckleProperty2D.type2D        = Structural.ETABS.Analysis.ETABSPropertyType2D.Deck;
                    speckleProperty2D.shellType     = speckleShellType;
                    speckleProperty2D.applicationId = GUID;
                    return(speckleProperty2D);
                }
                else if (deckType == eDeckType.Unfilled)
                {
                    var speckleProperty2D = new ETABSProperty2D.DeckUnFilled();
                    Model.PropArea.GetDeckUnfilled(property,
                                                   ref ribDepth,
                                                   ref ribWidthTop,
                                                   ref ribWidthBot,
                                                   ref ribSpacing,
                                                   ref shearThickness,
                                                   ref unitWeight);
                    speckleProperty2D.RibDepth       = ribDepth;
                    speckleProperty2D.RibWidthTop    = ribWidthTop;
                    speckleProperty2D.RibWidthBot    = ribWidthBot;
                    speckleProperty2D.RibSpacing     = ribSpacing;
                    speckleProperty2D.ShearThickness = shearThickness;
                    speckleProperty2D.UnitWeight     = unitWeight;
                    speckleProperty2D.deckType       = Structural.ETABS.Analysis.DeckType.Filled;
                    setProperties(speckleProperty2D, matProp, thickness, property);
                    speckleProperty2D.type2D        = Structural.ETABS.Analysis.ETABSPropertyType2D.Deck;
                    speckleProperty2D.shellType     = speckleShellType;
                    speckleProperty2D.applicationId = GUID;
                    return(speckleProperty2D);
                }
                else if (deckType == eDeckType.SolidSlab)
                {
                    var speckleProperty2D = new ETABSProperty2D.DeckSlab();
                    Model.PropArea.GetDeckSolidSlab(property, ref slabDepth, ref shearStudDia, ref shearStudDia, ref shearStudFu);
                    speckleProperty2D.SlabDepth    = slabDepth;
                    speckleProperty2D.ShearStudDia = shearStudDia;
                    speckleProperty2D.ShearStudFu  = shearStudFu;
                    speckleProperty2D.ShearStudHt  = shearStudHt;
                    speckleProperty2D.deckType     = Structural.ETABS.Analysis.DeckType.SolidSlab;
                    setProperties(speckleProperty2D, matProp, thickness, property);
                    speckleProperty2D.type2D        = Structural.ETABS.Analysis.ETABSPropertyType2D.Deck;
                    speckleProperty2D.shellType     = speckleShellType;
                    speckleProperty2D.applicationId = GUID;
                    return(speckleProperty2D);
                }
            }
            int s = Model.PropArea.GetSlab(property, ref slabType, ref shellType, ref matProp, ref thickness, ref color, ref notes, ref GUID);

            if (s == 0)
            {
                var specklePropery2DSlab = new ETABSProperty2D();
                setProperties(specklePropery2DSlab, matProp, thickness, property);
                specklePropery2DSlab.type2D = Structural.ETABS.Analysis.ETABSPropertyType2D.Slab;
                double overallDepth     = 0;
                double slabThickness    = 0;
                double stemWidthTop     = 0;
                double stemWidthBot     = 0;
                double ribSpacingDir1   = 0;
                double ribSpacingDir2   = 0;
                double ribSpacing       = 0;
                int    ribParrallelTo   = 0;
                var    speckleShellType = ConvertShellType(shellType);
                if (slabType == eSlabType.Waffle)
                {
                    var speckleProperty2D = new ETABSProperty2D.WaffleSlab();
                    Model.PropArea.GetSlabWaffle(property, ref overallDepth, ref slabThickness, ref stemWidthTop, ref stemWidthBot, ref ribSpacingDir1, ref ribSpacingDir2);
                    speckleProperty2D.OverAllDepth   = overallDepth;
                    speckleProperty2D.StemWidthBot   = stemWidthBot;
                    speckleProperty2D.StemWidthTop   = stemWidthTop;
                    speckleProperty2D.RibSpacingDir1 = ribSpacingDir1;
                    speckleProperty2D.RibSpacingDir2 = ribSpacingDir2;
                    speckleProperty2D.slabType       = Structural.ETABS.Analysis.SlabType.Waffle;
                    speckleProperty2D.deckType       = Structural.ETABS.Analysis.DeckType.Null;
                    setProperties(speckleProperty2D, matProp, thickness, property);
                    speckleProperty2D.shellType     = speckleShellType;
                    speckleProperty2D.applicationId = GUID;
                    return(speckleProperty2D);
                }
                else if (slabType == eSlabType.Ribbed)
                {
                    var speckleProperty2D = new ETABSProperty2D.RibbedSlab();
                    Model.PropArea.GetSlabRibbed(property, ref overallDepth, ref slabThickness, ref stemWidthTop, ref stemWidthBot, ref ribSpacing, ref ribParrallelTo);
                    speckleProperty2D.OverAllDepth   = overallDepth;
                    speckleProperty2D.StemWidthBot   = stemWidthBot;
                    speckleProperty2D.StemWidthTop   = stemWidthTop;
                    speckleProperty2D.RibSpacing     = ribSpacing;
                    speckleProperty2D.RibsParallelTo = ribParrallelTo;
                    speckleProperty2D.slabType       = Structural.ETABS.Analysis.SlabType.Ribbed;
                    speckleProperty2D.deckType       = Structural.ETABS.Analysis.DeckType.Null;
                    setProperties(speckleProperty2D, matProp, thickness, property);
                    speckleProperty2D.shellType     = speckleShellType;
                    speckleProperty2D.applicationId = GUID;
                    return(speckleProperty2D);
                }
                else
                {
                    switch (slabType)
                    {
                    case eSlabType.Slab:
                        specklePropery2DSlab.slabType = Structural.ETABS.Analysis.SlabType.Slab;
                        break;

                    case eSlabType.Drop:
                        specklePropery2DSlab.slabType = Structural.ETABS.Analysis.SlabType.Drop;
                        break;

                    case eSlabType.Mat:
                        specklePropery2DSlab.slabType = Structural.ETABS.Analysis.SlabType.Mat;
                        break;

                    case eSlabType.Footing:
                        specklePropery2DSlab.slabType = Structural.ETABS.Analysis.SlabType.Footing;
                        break;

                    default:
                        specklePropery2DSlab.slabType = Structural.ETABS.Analysis.SlabType.Null;
                        break;
                    }
                    specklePropery2DSlab.deckType      = Structural.ETABS.Analysis.DeckType.Null;
                    specklePropery2DSlab.shellType     = speckleShellType;
                    specklePropery2DSlab.applicationId = GUID;
                    return(specklePropery2DSlab);
                }
            }
            return(null);
        }
コード例 #12
0
 // eDeckType
 internal static CSiProgram.eDeckType ToCSi(eDeckType enumValue)
 {
     return((CSiProgram.eDeckType)enumValue);
 }