This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon.loginmodule; | |
import com.electrotank.electroserver5.extensions.BaseLoginEventHandler; | |
import com.electrotank.electroserver5.extensions.ChainAction; | |
import com.electrotank.electroserver5.extensions.LoginContext; | |
import com.electrotank.electroserver5.extensions.api.UserServerVariableResponse; | |
import com.electrotank.electroserver5.extensions.api.value.EsObject; | |
import com.electrotank.electroserver5.extensions.api.value.EsObjectRO; | |
public class Login extends BaseLoginEventHandler{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<Extension> | |
<Name>FunES</Name> | |
<EventHandlers> | |
<LoginHandlers> | |
<LoginHandler> | |
<Handle>Login</Handle> | |
<Type>Java</Type> | |
<Path>com.cgon.loginmodule.Login</Path> | |
</LoginHandler> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import com.electrotank.electroserver5.api.ConnectionResponse; | |
import com.electrotank.electroserver5.api.EsObject; | |
import com.electrotank.electroserver5.api.LoginRequest; | |
import com.electrotank.electroserver5.api.LoginResponse; | |
import com.electrotank.electroserver5.api.MessageType; | |
import com.electrotank.electroserver5.api.PluginMessageEvent; | |
import com.electrotank.electroserver5.api.PluginRequest; | |
import com.electrotank.electroserver5.connection.AvailableConnection; | |
import com.electrotank.electroserver5.connection.TransportType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun max_case (xs) = | |
case xs of | |
[] => NONE | |
| x::xs' => let fun non_empty_max (ys) = | |
case ys of | |
[] => x | |
| y::ys' => let val tl_ans = non_empty_max (ys') | |
in | |
if y > tl_ans | |
then y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun remove_duplicates (xs) = | |
case xs of | |
[]=>[] | |
| x::xs' => if List.exists (fn y=> x=y) xs' | |
then remove_duplicates (xs') | |
else x::remove_duplicates (xs') | |
val test_remove_duplicates = remove_duplicates ([3,3,3,3,5,5,5,5,6,6,6,6,7]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*We need a mutable list to store the list of registered callbacks.*) | |
(*The initial list will be empty.*) | |
val cbs : (int -> unit) list ref = ref [] | |
(*We need a public function to register the callbacks on the the callback list*) | |
fun registerCallBack f = | |
cbs := f::(!cbs) | |
(*When a specific action occurs we will call this function.*) | |
(*This function will call each call back with a parameter.*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fs; | |
/** | |
* This interface is responsible for holding the closures when it comes to map. | |
* It uses two generic types. One for the argument and one for the return type. | |
* @param <B> Generic type | |
* @param <A> Generic type | |
*/ | |
public interface Func<B,A> { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fs; | |
public interface CallBack { | |
void m(int e); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chp1.simuduck.v3; | |
public interface Animal { | |
void makeSound(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chp1.designpuzzle; | |
public interface WeaponBehaviour { | |
String useWeapon(); | |
} |