public void PopulateFromState(ISoundState soundState)
        {
            if (!(soundState is IntervalSoundState))
            { throw new Exception(string.Format("Unable to cast [{0}] to IntervalSoundState", soundState.GetType())); }

            var castState = (soundState as IntervalSoundState);

            ColumnPosition = castState.ColumnPosition;
            RowPosition = castState.RowPosition;
            Volume = castState.Volume;
            Interval = castState.Interval;
            LoadFile(castState.Filename);
        }
Example #2
0
        public void PopulateFromState(ISoundState soundState)
        {
            if(!(soundState is AmbientState))
            { throw new Exception(string.Format("Unable to cast [{0}] to AmbientState", soundState.GetType())); }

            var castState = (soundState as AmbientState);

            ColumnPosition = castState.ColumnPosition;
            RowPosition = castState.RowPosition;
            Volume = castState.Volume;
            isLooping = castState.isLooping;
            LoadFile(castState.Filename);
        }