約 3,977,902 件
https://w.atwiki.jp/wnt0/pages/39.html
状態における振る舞いをそれぞれのクラスとして分割し、局所化する 頻繁に状態が変わるような場合には、オブジェクトの生成処理のオーバーヘッドが大きくなる 最初に全ての状態オブジェクトを生成して、オブジェクトの切り替えを行う http //en.wikipedia.org/wiki/State_pattern のJavaコードをC++にした #include iostream #include string #include ctype.h using namespace std; // prototypeclass StateContext; // State Classclass State {public virtual void writeName(StateContext *stateContext, string name) = 0;}; // ConcreteState Classclass StateA public State {public virtual void writeName(StateContext *stateContext, string name);}; // ConcreteState Classclass StateB public State {public StateB() { count = 0; } virtual void writeName(StateContext *stateContext, string name);private int count;}; // Context Classclass StateContext {public StateContext() { myState = NULL; setState(new StateA()); } void setState(State *newState) { if (myState != NULL) delete myState; myState = newState; } void writeName(const string name) { myState- writeName(this, name); }private State *myState;}; // StateA writeNamevoid StateA writeName(StateContext *stateContext, string name) { string iterator it = name.begin(); while (it != name.end()) { *it = tolower(*it); ++it; } cout name endl; stateContext- setState(new StateB());} // StateB writeNamevoid StateB writeName(StateContext *stateContext, string name) { string iterator it = name.begin(); while (it != name.end()) { *it = toupper(*it); ++it; } cout name endl; if (++count 1) { stateContext- setState(new StateA()); }} // clientint main() { StateContext *sc = new StateContext(); sc- writeName("Monday"); sc- writeName("Tuesday"); sc- writeName("Wednesday"); sc- writeName("Thursday"); sc- writeName("Saturday"); sc- writeName("Sunday"); delete sc; return 0;} 出力 monday TUESDAY WEDNESDAY thursday SATURDAY SUNDAY http //www.dofactory.com/Patterns/PatternState.aspx のC#コードをC++にした Structural example #include iostream #include typeinfo using namespace std; // prototypeclass Context; // The State abstract classclass State {public virtual void Handle(Context *context) = 0;}; // The Context classclass Context {public // constructor Context(State *state) { _state = NULL; SetState(state); } virtual ~Context() { delete _state; } // Get or Set the state State* GetState() { return _state; } void SetState(State *state) { if (_state != NULL) delete _state; _state = state; cout "State " typeid(*state).name() endl; } // Request void Request() { _state- Handle(this); }private State *_state;}; // A ConcreteState classclass ConcreteStateA public State {public virtual void Handle(Context *context);}; // A ConcreteState classclass ConcreteStateB public State {public virtual void Handle(Context *context);}; // ConcreteStateA Handlevoid ConcreteStateA Handle(Context *context) { context- SetState(new ConcreteStateB());} // ConcreteStateB Handlevoid ConcreteStateB Handle(Context *context) { context- SetState(new ConcreteStateA());} // clientint main() { // Setup context in a state Context *c = new Context(new ConcreteStateA()); // Issue requests, which toggles state c- Request(); c- Request(); c- Request(); c- Request(); delete c; return 0;} 出力(g++の場合) State 14ConcreteStateA State 14ConcreteStateB State 14ConcreteStateA State 14ConcreteStateB State 14ConcreteStateA Real World example #include iostream #include string using namespace std; class Account; // The State abstract classclass State {protected Account *account; double balance; // 残高 double interest; double lowerLimit; double upperLimit; string state_name;public // Properties Account* getAccount(); void setAccount(Account *value); double getBalance() { return balance; } void setBalance(double value) { balance = value; } virtual void Deposit(double amount) = 0; virtual void Withdraw(double amount) = 0; virtual void PayInterest() = 0; string GetName() { return state_name; }}; // The Context classclass Account {private State *_state; string _owner;public // Constructor Account(const string owner); // Destructor virtual ~Account() { delete _state; } // Properties double getBalance() { return _state- getBalance(); } State* getState() { return _state; } void setState(State *state) { delete _state; _state = state; } void Deposit(double amount) { _state- Deposit(amount); cout "Deposited $" amount " ---" endl; cout " Balance = $" getBalance() endl; cout " Status = " getState()- GetName() endl; cout endl; } void Withdraw(double amount) { _state- Withdraw(amount); cout "Withdraw $" amount " ---" endl; cout " Balance = $" getBalance() endl; cout " Status = " getState()- GetName() endl; cout endl; } void PayInterest() { _state- PayInterest(); cout "Interest Paid ---" endl; cout " Balance = $" getBalance() endl; cout " Status = " getState()- GetName() endl; cout endl; }}; // A ConcreteState class// Red indicates that account is overdrawnclass RedState public State {private double _serviceFee;public // Constructor RedState(State *state) { balance = state- getBalance(); account = state- getAccount(); Initialize(); }private void Initialize() { // Should come from a datasource interest = 0.0; lowerLimit = -100.0; upperLimit = 0.0; _serviceFee = 15.00; state_name = "RedState"; }public virtual void Deposit(double amount) { balance += amount; StateChangeCheck(); } virtual void Withdraw(double amount) { amount -= _serviceFee; cout "No funds available for withdrawal!" endl; } virtual void PayInterest() { // No interest is paid }private void StateChangeCheck();}; // A ConcreteState class// Silver indicates a non-interest bearing stateclass SilverState public State {public // Overloaded constructors SilverState(State *state) { balance = state- getBalance(); account = state- getAccount(); Initialize(); } SilverState(double balance, Account *account) { this- balance = balance; this- account = account; Initialize(); }private void Initialize() { // Should come from a datasource interest = 0.0; lowerLimit = 0.0; upperLimit = 1000.0; state_name = "SilverState"; }public virtual void Deposit(double amount) { balance += amount; StateChangeCheck(); } virtual void Withdraw(double amount) { balance -= amount; StateChangeCheck(); } virtual void PayInterest() { balance += interest * balance; StateChangeCheck(); }private void StateChangeCheck();}; // A ConcreteState class// Gold indicates an interest bearing stateclass GoldState public State {public // Overloaded constructors GoldState(State *state) { balance = state- getBalance(); account = state- getAccount(); Initialize(); } GoldState(double balance, Account *account) { this- balance = balance; this- account = account; Initialize(); }private void Initialize() { // Should come from a database interest = 0.05; lowerLimit = 1000.0; upperLimit = 10000000.0; state_name = "GoldState"; }public virtual void Deposit(double amount) { balance += amount; StateChangeCheck(); } virtual void Withdraw(double amount) { balance -= amount; StateChangeCheck(); } void PayInterest() { balance += interest * balance; StateChangeCheck(); }private void StateChangeCheck();}; //// State ////Account* State getAccount() { return account;} void State setAccount(Account *value) { account = value;} //// Account ////Account Account(const string owner) { // New accounts are Silver by default _owner = owner; _state = new SilverState(0.0, this);} //// RedState ////void RedState StateChangeCheck() { if (balance upperLimit) { account- setState(new SilverState(this)); }} //// SilverState ////void SilverState StateChangeCheck() { if (balance lowerLimit) { account- setState(new RedState(this)); } else if (balance upperLimit) { account- setState(new GoldState(this)); }} //// GoldState ////void GoldState StateChangeCheck() { if (balance 0.0) { account- setState(new RedState(this)); } else if (balance lowerLimit) { account- setState(new SilverState(this)); }} ///////////// Entry point into console application.int main() { // Open a new account Account *account = new Account("Jim Johnson"); // Apply financial transactions account- Deposit(500.0); // deposit 預け入れ account- Deposit(300.0); account- Deposit(550.0); account- PayInterest(); // interest 利子 account- Withdraw(2000.00); // withdraw 引き落とし account- Withdraw(1100.00); delete account; return 0;} 出力 Deposited $500 --- Balance = $500 Status = SilverState Deposited $300 --- Balance = $800 Status = SilverState Deposited $550 --- Balance = $1350 Status = GoldState Interest Paid --- Balance = $1417.5 Status = GoldState Withdraw $2000 --- Balance = $-582.5 Status = RedState No funds available for withdrawal! Withdraw $1100 --- Balance = $-582.5 Status = RedState 参考サイト デザインパターンを“喩え話”で分かり易く理解する http //www.netlaputa.ne.jp/~hijk/study/oo/designpattern.html TECHSCORE http //www.techscore.com/tech/DesignPattern/index.html/ Programing Place http //www.geocities.jp/ky_webid/index_old.html デザインパターンの骸骨たち http //www002.upp.so-net.ne.jp/ys_oota/mdp/ デザインパターンの使い方 State http //japan.internet.com/developer/20081224/26.html
https://w.atwiki.jp/tts-script/pages/107.html
stateとは? タイルを複数枚重ねて右クリック>メニューから>create state(青い輪のアイコン)を押すと 1枚にまとまる 以降、そのタイルにカーソルを合わせてキーボード左上の数字を押すと その数字に対応したタイルに切り替わる 主にルールブックの切り替えに使われる ◇切り替えの順番がおかしくなる 基本上から下の順でstateの番号が割り振られるが、 うまくいかない場合は CTRLで選びたい順番でひとつずつ選択してから 最初に表示したいタイルを右クリック>create stateでやってみよう ・仕様として、 各オブジェの中央?を基準に切り替わるので 範囲選択時に重ねなくてもstateは可能
https://w.atwiki.jp/cocet/pages/13.html
13 state 【名】状態、州、【他】意見を述べる <COCETでの注釈> The United States of America(アメリカ合衆国)のStateだが、科学用語としては「状態」や「意見を述べる」の意味で使うことが多い。
https://w.atwiki.jp/taskeru/pages/31.html
■State■ [~の状態になった時?一つのプロファイルに二つまで指定可能。値を定期的にチェック] Airplane Mode ⇒機内モードの時。 Battery Level ⇒バッテリーの% が From ~ To 間の時 Bluetooth Connected ⇒Bluetooth機器が接続された時。機器名やアドレスが指定できるが、それ以外の機器が接続されても発生した。バグ? Calendar Entry ⇒googleカレンダーのエントリーを指定。 Cell Near ⇒指定した携帯基地局エリア内に入った時。Llamaアプリみたいなことができる。 Docked ⇒ Headset Plugged ⇒ Incoming Call ⇒電話がかかって来た時。特定の相手の指定も可能。 Keyboard Out ⇒ Light Level ⇒画面に受ける光の強さ が From ~ To の間の時。日中なら42以上?明るさを測るアプリで明るさ測って値を調整 Media Button ⇒ Missed Call ⇒ Mobile Network ⇒ Orientation ⇒本体の傾きの状態。仰向け/うつ伏せ etc Power ⇒ Proximity Sensor ⇒近接センサー。 Signal Strength ⇒ Unread Text ⇒ USB Plugged ⇒ Variable Value ⇒変数の値が条件に一致した時。★超便利 Wifi Connected ⇒指定したWifi環境に繋がった時。※SSIDやMACアドレスを指定る必要あり。 Wifi Near ⇒指定したWifi環境が近くにある時。※SSIDやMACアドレスを指定る必要あり。
https://w.atwiki.jp/unitymemo/pages/92.html
void Update () { if (state==0) { clearFloor(); floorNo++; GameObject.Find("Status").GetComponent TextMesh ().text = ""; GameObject.Find("Info").GetComponent TextMesh ().text = " Floor "+(floorNo); GameObject.Find("Info2").GetComponent TextMesh ().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } else if(state==1) { if( Input.anyKeyDown ) { newFloor(); GameObject.Find("Info").GetComponent TextMesh ().text = ""; GameObject.Find("Info2").GetComponent TextMesh ().text = ""; state=2; MapRoot.SetActive(true); } } else if (state==2) { timer--; string temp="Floor"+floorNo+" Hp"+hp+" Score"+score+" Timer"+timer+"\n\n\n\n"; GameObject.Find("Status").GetComponent TextMesh ().text = temp; if(checkTresure()) { isTresure=true; Vector2 pos=new Vector2( 9*3-1.5f, 4*3+1.5f); dropSprite3(door[1],pos.x,pos.y,"Tresure"); } } else if (state==99) { myItems="";showItems(); clearFloor(); floorNo=1; GameObject.Find("Status").GetComponent TextMesh ().text = ""; GameObject.Find("Info").GetComponent TextMesh ().text = "GAME OVER"; GameObject.Find("Info2").GetComponent TextMesh ().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } }
https://w.atwiki.jp/opengles/pages/38.html
State and State Requests A complete list of symbolic constants for states is shown in the tables in [6.2]. Simple Queries [6.1.1] void GetBooleanv(enum value, boolean *data); void GetIntegerv(enum value, int *data); void GetFloatv(enum value, float *data); boolean IsEnabled(enum value); Pointer and String Queries [6.1.5] ubyte *GetString(enum name); // name VENDOR, RENDERER, VERSION, SHADING_LANGUAGE_VERSION, EXTENSIONS
https://w.atwiki.jp/type74rx-t/pages/244.html
Update History 20/10/23Fixed a bug that caused HP to not be displayed as an integer in some cases. This plugin is compatible with RPG Maker MV and RPG Maker MZ. Summary You can create a state where your HP remains even if you take damage so large that your HP drops to 0. It also allows you to keep a certain amount of HP even if you take a lot of damage. Applying this effect to an enemy s setting could make the enemy s behavior even more varied. Of course, you can also set up the actors, so try to find different ways to use it. Usage Fill in the notes section of the states. Example 1 If you want to create a state where your HP is at least 5% of your maximum and you want to hold on at 1 HP even if you get hit by an attack that reduces your HP to 0 Guts 5 Example 2 If you want to create a state where you can maintain HP at 70% of maximum value even if you receive attack that reduces HP to less than 70% of maximum value SuperGuts 70 All numbers are percentages. You can also put multiple guts states on it, so use it to your advantage. The state also has a once you have withstood an attack that reduces your HP to 0, or an attack that reduces your HP to a specified value or less, the state is immediately canceled, regardless of the condition for canceling the state. But, you can add the following setting to the guts state so that the state is removed at the end of a turn that you hold on to(In TPB mode, when it s that battler s turn after hold on). RemoveGutsAtEndOfTurn Guts (except for Super guts) is automatically removed when you reach a lower HP than the value of guts you set, even if you don t hold on at 1 HP. Removed states in any setting will not be revival even if HP is healed. Caution If you want to create more than one guts state, you must set them all to different values. If you set more than one state with the same number, it will not behave correctly when you receive more than one of those states. Notes You don t need to worry about the plugin parameters. It s just that the way you set up the notes field is different depending on whether you are using the English or Japanese version. Download https //img.atwikiimg.com/www20.atwiki.jp/type74rx-t/attach/243/437/RX_T_GutsState.zip
https://w.atwiki.jp/kbhyakka/pages/321.html
808 State 90
https://w.atwiki.jp/pghlife/pages/18.html
必要なもの(F-1の場合) DL-54 (http //www.dmv.state.pa.us/pdotforms/dl_forms/dl-54a.pdf) パスポート VISA I-94 SSN denial letter 大学のverification letter $13.50の小切手またはマネーオーダー 手続き場所 PennDOTDowntownがお勧め。 Pennhillsが駐車しやすくて行きやすいが、担当者が自信たっぷりに嘘をついて発行されなかった。 Pennhillsは土曜もやってる(木曜休み)なので、平日行けない人は残念ながらここに行くしか。 East LibertyのAAAにもPhoto License Centerがあるが、ここで新規発行はできない。
https://w.atwiki.jp/type74rx-t/pages/236.html
This plugin is compatible with RPG Maker MV and RPG Maker MZ. Summary If everyone suffers a state that prevents them from moving (no automatic removal) during combat, they are defeated. You will be able to use this to create "petrified" and other states. By default, if the situation described above occurs, you will continue to be attacked unilaterally by enemies until your party is wiped out, or in some cases, the game will stop progressing. And, as another feature, you can set it up to be defeated if the entire party is subjected to a certain state, regardless of restrictions or removal conditions. Usage [State Settings] Create a state that meets the following conditions. The restriction is "cannot move". Auto-removal timing is set to "None". "Remove by Damage" is not checked. ★If you want to pretend that you have been defeated under a special state condition regardless of the restriction or removal conditions Fill in the notes section of the statw. DefeatState Spec All of these features apply to allies only. Notes You don t need to worry about the plugin parameters. It s just that the way you set up the notes field is different depending on whether you are using the English or Japanese version. Download https //img.atwikiimg.com/www20.atwiki.jp/type74rx-t/attach/233/393/RX_T_DefeatState.zip