//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// MessagesEmojiGameInfoClassArray is adapter for slice of MessagesEmojiGameInfoClass.
type MessagesEmojiGameInfoClassArray []MessagesEmojiGameInfoClass

// Sort sorts slice of MessagesEmojiGameInfoClass.
func ( MessagesEmojiGameInfoClassArray) ( func(,  MessagesEmojiGameInfoClass) bool) MessagesEmojiGameInfoClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MessagesEmojiGameInfoClass.
func ( MessagesEmojiGameInfoClassArray) ( func(,  MessagesEmojiGameInfoClass) bool) MessagesEmojiGameInfoClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MessagesEmojiGameInfoClass.
func ( MessagesEmojiGameInfoClassArray) ( func( MessagesEmojiGameInfoClass) bool) MessagesEmojiGameInfoClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MessagesEmojiGameInfoClassArray) () ( MessagesEmojiGameInfoClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MessagesEmojiGameInfoClassArray) () ( MessagesEmojiGameInfoClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MessagesEmojiGameInfoClassArray) () ( MessagesEmojiGameInfoClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MessagesEmojiGameInfoClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MessagesEmojiGameInfoClassArray) () ( MessagesEmojiGameInfoClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsMessagesEmojiGameDiceInfo returns copy with only MessagesEmojiGameDiceInfo constructors.
func ( MessagesEmojiGameInfoClassArray) () ( MessagesEmojiGameDiceInfoArray) {
	for ,  := range  {
		,  := .(*MessagesEmojiGameDiceInfo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyAvailable appends only Available constructors to
// given slice.
func ( MessagesEmojiGameInfoClassArray) ( []*MessagesEmojiGameDiceInfo) []*MessagesEmojiGameDiceInfo {
	for ,  := range  {
		,  := .AsAvailable()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsAvailable returns copy with only Available constructors.
func ( MessagesEmojiGameInfoClassArray) () ( []*MessagesEmojiGameDiceInfo) {
	return .AppendOnlyAvailable()
}

// FirstAsAvailable returns first element of slice (if exists).
func ( MessagesEmojiGameInfoClassArray) () ( *MessagesEmojiGameDiceInfo,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsAvailable()
}

// LastAsAvailable returns last element of slice (if exists).
func ( MessagesEmojiGameInfoClassArray) () ( *MessagesEmojiGameDiceInfo,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsAvailable()
}

// PopFirstAsAvailable returns element of slice (if exists).
func ( *MessagesEmojiGameInfoClassArray) () ( *MessagesEmojiGameDiceInfo,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsAvailable()
}

// PopAsAvailable returns element of slice (if exists).
func ( *MessagesEmojiGameInfoClassArray) () ( *MessagesEmojiGameDiceInfo,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsAvailable()
}

// MessagesEmojiGameDiceInfoArray is adapter for slice of MessagesEmojiGameDiceInfo.
type MessagesEmojiGameDiceInfoArray []MessagesEmojiGameDiceInfo

// Sort sorts slice of MessagesEmojiGameDiceInfo.
func ( MessagesEmojiGameDiceInfoArray) ( func(,  MessagesEmojiGameDiceInfo) bool) MessagesEmojiGameDiceInfoArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of MessagesEmojiGameDiceInfo.
func ( MessagesEmojiGameDiceInfoArray) ( func(,  MessagesEmojiGameDiceInfo) bool) MessagesEmojiGameDiceInfoArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of MessagesEmojiGameDiceInfo.
func ( MessagesEmojiGameDiceInfoArray) ( func( MessagesEmojiGameDiceInfo) bool) MessagesEmojiGameDiceInfoArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( MessagesEmojiGameDiceInfoArray) () ( MessagesEmojiGameDiceInfo,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( MessagesEmojiGameDiceInfoArray) () ( MessagesEmojiGameDiceInfo,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *MessagesEmojiGameDiceInfoArray) () ( MessagesEmojiGameDiceInfo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  MessagesEmojiGameDiceInfo
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *MessagesEmojiGameDiceInfoArray) () ( MessagesEmojiGameDiceInfo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}