Example #1
0
		public GasTrapEffectFactory(TrapEffectFactory gasTrapContentFactory, DiceCup gasTrapTableDie, string gasTrapContents)
		{
			// TODO: Complete member initialization
			this.gasTrapContentFactory = gasTrapContentFactory;
			this.gasTrapTableDie = gasTrapTableDie;
			this.gasTrapContents = gasTrapContents;
		}
		public MultiRollEffectFactory(TrapEffectFactory effectFactory, DiceCup tableDiceRoll, int numberOfReRolls, string effectDescription)
		{
			this.effectFactory = effectFactory;
			this.tableDiceRoll = tableDiceRoll;
			this.numberOfReRolls = numberOfReRolls;
			this.effectDescription = effectDescription;
		}
Example #3
0
        public DiceCupTest()
        {
            this.factoryMock    = new Mock <DieFactory>();
            this.dieMock        = new Mock <IDie>();
            this.subscriberMock = new Mock <IRollDieObserver>();

            this.sut = new DiceCup(this.factoryMock.Object);

            this.factoryMock.Setup(mock => mock.GetDie()).Returns(this.dieMock.Object);
            this.dieMock.Setup(mock => mock.GetFaceValue()).Returns(this.faceValue);
        }
Example #4
0
 public bool Reroll(PharoahDie die)
 {
     if (!die.isActiveDie())
     {
         GameState.Message("Cannot use Scarab on non-active die.");
         return(false);
     }
     GameState.Message("Rerolling " + die.name);
     DiceCup.StartRolling();
     die.ReadyToRoll();
     die.RollDie();
     isConsumed = true;
     return(true);
 }
Example #5
0
		public MechanizedBaseFactory(TrapEffectFactory mechanismFactory, DiceCup mechanismTableDie, string effectDescription)
		{
			this.mechanismFactory = mechanismFactory;
			this.mechanismTableDie = mechanismTableDie;
			this.effectDescription = effectDescription;
		}
		public ComplexTrapEffectFactory(TrapEffectFactory effectFactory, DiceCup mainTableDice, string effectDescription)
		{
			this.effectFactory = effectFactory;
			this.mainTableDice = mainTableDice;
			this.effectDescription = effectDescription;
		}
Example #7
0
 public PitTrapEffectFactory(TrapEffectFactory pitContentEffectFactory, DiceCup pitTrapTableDie, string pitTrapContents)
 {
     this.pitContentEffectFactory = pitContentEffectFactory;
     this.pitTrapTableDie = pitTrapTableDie;
     this.pitTrapContents = pitTrapContents;
 }
Example #8
0
        private void LoadTables()
        {
            try
            {
                basePrimaryTableDie = TableLoader.GetTrapBaseTableDie();
                var trapBases = TableLoader.GetTrapBaseContents();

                mechanismTableDie = TableLoader.GetTrapMechanismTableDie();
                var mechanismTypes = TableLoader.GetTrapMechanismContents();

                effectPrimaryTableDie = TableLoader.GetTrapEffectsTableDie();
                var trapEffects = TableLoader.GetTrapEffectsContents();

                pitTrapTableDie = TableLoader.GetPitTrapTableDie();
                var pitContents = TableLoader.GetPitTrapContents();

                gasTrapTableDie = TableLoader.GetGasTrapTableDie();
                var gasTypes = TableLoader.GetGasTrpContents();

                trapDamageTableDie = TableLoader.GetTrapDamageTableDie();
                var trapDamages = TableLoader.GetTrapDamages();

                foreach (var damage in trapDamages)
                {
                    trapDamagesFactory.Add(damage.RollUpperBound, new SimpleFactory(damage.DamageDescription));
                }

                foreach (var mechanism in mechanismTypes)
                {
                    mechanismFactory.Add(mechanism.Key, new SimpleFactory(mechanism.Value));
                }

                foreach (var trapBase in trapBases)
                {
                    if (trapBase.MechanismTypeSpecified)
                    {
                        trapBaseFactory.Add(trapBase.RollUpperBound, new MechanizedBaseFactory(mechanismFactory, mechanismTableDie, trapBase.TrappedObjectOrArea));
                    }
                    else
                    {
                        trapBaseFactory.Add(trapBase.RollUpperBound, new SimpleFactory(trapBase.TrappedObjectOrArea));
                    }
                }

                foreach (var content in pitContents)
                {
                    pitContentEffectFactory.Add(content.RollUpperBound, new SimpleFactory(content.PitContent));
                }

                foreach (var gas in gasTypes)
                {
                    gasTrapContentFactory.Add(gas.RollUpperBound, new SimpleFactory(gas.GasName));
                }

                foreach (var trapEffect in trapEffects)
                {
                    if (trapEffect.RollAgain && trapEffect.NumberOfReRolls == 1)
                    {
                        effectFactory.Add(trapEffect.RollUpperBound, new ComplexTrapEffectFactory(effectFactory, effectPrimaryTableDie, trapEffect.EffectDescription));
                    }
                    else if (trapEffect.RollAgain && trapEffect.NumberOfReRolls > 1)
                    {
                        effectFactory.Add(trapEffect.RollUpperBound, new MultiRollEffectFactory(effectFactory, effectPrimaryTableDie, trapEffect.NumberOfReRolls, trapEffect.EffectDescription));
                    }
                    else if (trapEffect.HasSubtable && trapEffect.SubtableName == "PitContents")
                    {
                        effectFactory.Add(trapEffect.RollUpperBound, new PitTrapEffectFactory(pitContentEffectFactory, pitTrapTableDie, trapEffect.EffectDescription));
                    }
                    else if (trapEffect.HasSubtable && trapEffect.SubtableName == "GasType")
                    {
                        effectFactory.Add(trapEffect.RollUpperBound, new GasTrapEffectFactory(gasTrapContentFactory, gasTrapTableDie, trapEffect.EffectDescription));
                    }
                    else
                    {
                        effectFactory.Add(trapEffect.RollUpperBound, new SimpleFactory(trapEffect.EffectDescription));
                    }
                }
            }
            catch (Exception ex)
            {

                throw;
            }
        }
Example #9
0
 // Use this for initialization
 void Start()
 {
     s_instance = this;
     DeactivateWalls ();
 }