Exemplo n.º 1
0
 public AGSAudioSystem(IAudioSettings settings)
 {
     _playingSounds = new AGSConcurrentHashSet <ISound>();
     AudioClips     = new AGSBindingList <IAudioClip>(30);
     AudioClips.OnListChanged.Subscribe(onAudioClipsChanged);
     AudioRules = new AGSBindingList <IAudioRule>(5);
     Settings   = settings;
 }
Exemplo n.º 2
0
 public AGSComboBoxComponent(IUIFactory factory, IGameEvents gameEvents)
 {
     _uiFactory   = factory;
     _itemButtons = new List <IButton>();
     _items       = new AGSBindingList <object>(10);
     _items.OnListChanged.Subscribe(onListChanged);
     gameEvents.OnRepeatedlyExecute.Subscribe((_, __) => refreshDropDownLayout());
 }
Exemplo n.º 3
0
        private int _inUpdate; //For preventing re-entrancy

        public TreeTableLayout(IGameEvents gameEvents)
        {
            ColumnSizes           = new AGSBindingList <float>(10);
            Rows                  = new AGSBindingList <ITreeTableRowLayoutComponent>(10);
            OnRefreshLayoutNeeded = new AGSEvent();
            OnQueryLayout         = new AGSEvent <QueryLayoutEventArgs>();
            Rows.OnListChanged.Subscribe(onRowsChanged);
            gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
        }
Exemplo n.º 4
0
 public AGSGameState(ICustomProperties globalVariables, IAGSRoomTransitions roomTransitions,
                     Resolver resolver, IFocusedUI focusedUi)
 {
     Speed            = 100;
     Rooms            = new AGSBindingList <IRoom>(10);
     UI               = new AGSConcurrentHashSet <IObject> ();
     GlobalVariables  = globalVariables;
     FocusedUI        = focusedUi;
     _cutscene        = new Lazy <ICutscene> (() => resolver.Container.Resolve <ICutscene>());
     _roomTransitions = roomTransitions;
 }
Exemplo n.º 5
0
 public AGSGameState(ICustomProperties globalVariables, IAGSRoomTransitions roomTransitions,
                     Resolver resolver, IFocusedUI focusedUi, IViewport viewport)
 {
     Speed = 100;
     Rooms = new AGSBindingList <IRoom>(10);
     UI    = new AGSConcurrentHashSet <IObject> ();
     SecondaryViewports     = new AGSBindingList <IViewport>(5);
     viewport.RoomProvider  = this;
     viewport.Camera.Target = () => Player;
     Viewport         = viewport;
     GlobalVariables  = globalVariables;
     FocusedUI        = focusedUi;
     _cutscene        = new Lazy <ICutscene> (() => resolver.Container.Resolve <ICutscene>());
     _roomTransitions = roomTransitions;
 }
Exemplo n.º 6
0
#pragma warning restore CS0067

        public AGSRoom(string id, IAGSEdges edges, IGameEvents gameEvents,
                       IRoomEvents roomEvents, IGameState state, ICustomProperties properties,
                       IRoomLimitsProvider roomLimitsProvider)
        {
            _state             = state;
            RoomLimitsProvider = roomLimitsProvider;
            _gameEvents        = gameEvents;
            Events             = roomEvents;
            ID         = id;
            Objects    = new AGSConcurrentHashSet <IObject>();
            Areas      = new AGSBindingList <IArea>(5);
            ShowPlayer = true;
            _edges     = edges;
            Properties = properties;
            gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
        }
Exemplo n.º 7
0
 public AGSGameState(ICustomProperties globalVariables, IRoomTransitions roomTransitions,
                     Resolver resolver, IFocusedUI focusedUi, IViewport viewport,
                     IEvent <RoomTransitionEventArgs> onRoomChangeRequired, IAGSCursor cursor)
 {
     Speed                  = 100;
     _cursor                = cursor;
     Rooms                  = new AGSBindingList <IRoom>(10);
     UI                     = new AGSConcurrentHashSet <IObject> ();
     SecondaryViewports     = new AGSBindingList <IViewport>(5);
     RoomTransitions        = roomTransitions;
     viewport.RoomProvider  = this;
     viewport.Camera.Target = () => Player;
     Viewport               = viewport;
     GlobalVariables        = globalVariables;
     FocusedUI              = focusedUi;
     _cutscene              = new Lazy <ICutscene> (() => resolver.Container.Resolve <ICutscene>());
     OnRoomChangeRequired   = onRoomChangeRequired;
     _viewports             = new ViewportCollection(this);
 }
Exemplo n.º 8
0
        public ALSound(int source, float duration, float volume, float pitch, bool isLooping, float panning,
                       IConcurrentHashSet <string> tags, IAudioErrors errors, IAudioBackend backend)
        {
            //Using delegates to avoid heap allocations
            modifierChangeCallback = onModifierChanged;

            SoundModifiers = new AGSBindingList <ISoundModifier>(3);
            SoundModifiers.OnListChanged.Subscribe(onModifiersChanged);
            Tags      = tags;
            _tcs      = new TaskCompletionSource <object> (null);
            _backend  = backend;
            _source   = source;
            _volume   = volume;
            Duration  = duration;
            _pitch    = pitch;
            _panning  = panning;
            IsLooping = isLooping;
            _errors   = errors;
        }
Exemplo n.º 9
0
 public AGSInventory()
 {
     Items = new AGSBindingList <IInventoryItem> (20);
 }
Exemplo n.º 10
0
 public ResourceLoader()
 {
     ResourcePacks = new AGSBindingList <ResourcePack>(5);
     ResourcePacks.OnListChanged.Subscribe(args => _sortedResourcePacks = ResourcePacks.OrderByDescending(r => r.Priority).Select(r => r.Pack).ToList());
 }