package com.hyperfresh.mchyperchat.field;

import com.hyperfresh.mchyperchat.User;

/**
 * @author octopod
 */
public interface Field
{
	/**
	 * Returns a list of names of this field.
	 *
	 * @return an array of strings
	 */
	public String[] getFieldNames();

	/**
	 * Returns true if this field can potentially return different values every time it is used.
	 *
	 * <p>
	 *     Static fields will be processed into a theme's formats when it is registered,
	 *     whereas dynamic fields will be processed into messages every time a player chats.
	 * </p>
	 *
	 * <p>
	 *     If your Field returns the same value every time it is used, it is recommended that
	 *     you return {@code false} for this method or consider using {@code ConstantField} instead.
	 * </p>
	 *
	 * @return true if this field is dynamic
	 */
	public default boolean isDynamic()
	{
		return true;
	}

	/**
	 * Returns true if a player can type in this field in his/her message.
	 * Inlined fields, regardless of them being dynamic or not, will be processed when they chat.
	 *
	 * @return true if this field can be inlined
	 */
	public default boolean canInline()
	{
		return false;
	}

	/**
	 * Returns an array of expected argument sizes. Defaults to 0.
	 *
	 * @return an array of expected argument sizes
	 */
	public default int[] numArgs()
	{
		return new int[0];
	}

	/**
	 * Gets the value of the field. Optional arguments if the field takes any.
	 *
	 * @param args optional arguments
	 * @return the current value
	 */
	public String getFieldValue(User user, String... args);
}

@@ -77,16 +77,69 @@
 .User;%0A%0A
+import java.util.Collections;%0Aimport java.util.Set;%0A%0A
 /**%0A * @
@@ -347,866 +347,130 @@
 ld c
-an potentially return different values every time it is used.%0A%09 *%0A%09 * %3Cp%3E%0A%09 *     Static fields will be processed into a theme's formats when it is registered,%0A%09 *     whereas dynamic fields will be processed into messages every time a player chats.%0A%09 * %3C/p%3E%0A%09 *%0A%09 * %3Cp%3E%0A%09 *     If your Field returns the same value every time it is used, it is recommended that%0A%09 *     you return %7B@co
+ontains a certain FieldFlag.%0A%09 * @return%0A%09 */%0A%09public 
 de
- 
 fa
-lse%7D for this method or consider using %7B@code ConstantField%7D instead.%0A%09 * %3C/p%3E%0A%09 *%0A%09 * @return true if this field is dynamic%0A%09 */%0A%09public default boolean isDynamic()%0A%09%7B%0A%09%09return true;%0A%09%7D%0A%0A%09/**%0A%09 * Returns true if a player can type in this field in his/her message.%0A%09 * Inlined fields, regardless of them being dynamic or not, will be processed when they chat.%0A%09 *%0A%09 * @return true if this field can be inlined%0A%09 */%0A%09public default boolean canInline()%0A%09%7B%0A%09%09return false
+ult Set%3CFieldFlag%3E getFlags()%0A%09%7B%0A%09%09return Collections.emptySet()
 ;%0A%09%7D

replace canInline and isDynamic with getFlags in Field