Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
/ cafu_flow Public archive

🌊 Flow is interval event trigger for any games

License

Notifications You must be signed in to change notification settings

umm/cafu_flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cafu_flow

What

  • Flow is interval event trigger for any games

Requirement

  • cafu_core
  • cafu_generics
  • extra_collection
  • unity_module_stopwatch

Install

yarn add "umm/cafu_flow#^2.0.0"

Usage

Implement IFlowPresenter on your Presenter

public class MyPresenter : IModelFlowPresenter<MyModel>
{
    public class Factory : DefaultPresenterFactory<MyPresenter>
    {
        protected override void Initialize(MyPresenter instance)
        {
            base.Initialize(instance);
            instance.ModelFlowUseCase = new ModelFlowUseCase<MyModel, MyEntity, MyEntityList, MyTranslator>.Factory().Create();
        }
    }

    public IModelFlowUseCase<MyModel> ModelFlowUseCase { get; private set; }
}
presenter.ModelFlowAsObservable.Subscribe(model => /* do any thing on model event triggered */);
presenter.StartFlow(); // start your model flow 
presenter.StopFlow(); // stop your model flow 

License

Copyright (c) 2018 Takuma Maruyama

Released under the MIT license, see LICENSE.txt