Ejemplo n.º 1
0
 public Treasure(int sbv, Wealth w, string e, string d)
 {
     sellback_value = sbv;
     max_wealth     = w;
     effect         = e;
     description    = d;
 }
Ejemplo n.º 2
0
        public static Wealth operator+(Wealth w, int val)
        {
            Wealth newWealth = new Wealth
            {
                WealthValue = w.WealthValue + val
            };

            return(newWealth);
        }
Ejemplo n.º 3
0
        private static void getAllPossibleMove(Spaces s, int landDist, int seaDist, ref SpaceMouvement[] sm, Wealth w)
        {
            int index = s.ID;

            sm[index].Visited  = true;
            sm[index].Distance = landDist + seaDist;

            if (landDist + seaDist == Math.Max(w.LandMouvement(), w.SeaMouvement()))
            {
                return;
            }

            int newSea;
            int newLand;

            foreach (Spaces connection in s.Connections)
            {
                newSea  = seaDist;
                newLand = landDist;

                if (s.Type == Spaces.TYPE_SEA || connection.Type == Spaces.TYPE_SEA || s.Type == Spaces.TYPE_ISLAND || connection.Type == Spaces.TYPE_ISLAND)
                {
                    if (w.SeaMouvement() == seaDist)
                    {
                        continue;
                    }
                    newSea++;
                }
                else
                {
                    if (w.LandMouvement() == landDist)
                    {
                        continue;
                    }
                    newLand++;
                }

                if (sm[connection.ID].Visited == false || (sm[connection.ID].Visited == true && sm[connection.ID].Distance > (newLand + newSea)))
                {
                    getAllPossibleMove(connection, newLand, newSea, ref sm, w);
                }
            }
        }