mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Rename enumerateInstructions to enumerateAllInstructions
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
createTree,
|
||||
type InstructionOrExpressionTreeNode,
|
||||
} from '../../../InstructionOrExpression/CreateTree';
|
||||
import { enumerateInstructions } from '../../../InstructionOrExpression/EnumerateInstructions';
|
||||
import { enumerateAllInstructions } from '../../../InstructionOrExpression/EnumerateInstructions';
|
||||
import {
|
||||
type EnumeratedInstructionOrExpressionMetadata,
|
||||
filterEnumeratedInstructionOrExpressionMetadataByScope,
|
||||
@@ -28,7 +28,7 @@ const style = {
|
||||
|
||||
export default class InstructionSelector extends Component<Props, {||}> {
|
||||
instructionsInfo: Array<EnumeratedInstructionOrExpressionMetadata> = filterEnumeratedInstructionOrExpressionMetadataByScope(
|
||||
enumerateInstructions(this.props.isCondition),
|
||||
enumerateAllInstructions(this.props.isCondition),
|
||||
this.props.scope
|
||||
);
|
||||
instructionsInfoTree: InstructionOrExpressionTreeNode = createTree(
|
||||
|
@@ -2,7 +2,7 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
enumerateObjectAndBehaviorsInstructions,
|
||||
enumerateInstructions,
|
||||
enumerateAllInstructions,
|
||||
getObjectParameterIndex,
|
||||
} from '../../InstructionOrExpression/EnumerateInstructions';
|
||||
import {
|
||||
@@ -126,7 +126,7 @@ export const useNewInstructionEditor = ({
|
||||
if (!isNewInstruction) {
|
||||
// Check if the instruction is an object/behavior instruction. If yes
|
||||
// select the object, which is the first parameter of the instruction.
|
||||
const allInstructions = enumerateInstructions(isCondition);
|
||||
const allInstructions = enumerateAllInstructions(isCondition);
|
||||
const instructionType: string = instruction.getType();
|
||||
const enumeratedInstructionMetadata = findInstruction(
|
||||
allInstructions,
|
||||
|
@@ -176,7 +176,7 @@ const enumerateExtensionInstructions = (
|
||||
/**
|
||||
* List all the instructions available.
|
||||
*/
|
||||
export const enumerateInstructions = (
|
||||
export const enumerateAllInstructions = (
|
||||
isCondition: boolean
|
||||
): Array<EnumeratedInstructionOrExpressionMetadata> => {
|
||||
let allInstructions = [];
|
||||
|
@@ -1,13 +1,13 @@
|
||||
// @flow
|
||||
import { createTree } from './CreateTree';
|
||||
import {
|
||||
enumerateInstructions,
|
||||
enumerateAllInstructions,
|
||||
getObjectParameterIndex,
|
||||
} from './EnumerateInstructions';
|
||||
|
||||
describe('EnumerateInstructions', () => {
|
||||
it('can enumerate instructions being conditions', () => {
|
||||
const instructions = enumerateInstructions(true);
|
||||
const instructions = enumerateAllInstructions(true);
|
||||
|
||||
// Test for the proper presence of a few conditions
|
||||
expect(instructions).toEqual(
|
||||
@@ -32,7 +32,7 @@ describe('EnumerateInstructions', () => {
|
||||
});
|
||||
|
||||
it('can enumerate instructions being actions', () => {
|
||||
const instructions = enumerateInstructions(false);
|
||||
const instructions = enumerateAllInstructions(false);
|
||||
|
||||
// Test for the proper presence of a few actions
|
||||
expect(instructions).toEqual(
|
||||
@@ -52,7 +52,7 @@ describe('EnumerateInstructions', () => {
|
||||
});
|
||||
|
||||
it('can create the tree of instructions', () => {
|
||||
const instructions = enumerateInstructions(true);
|
||||
const instructions = enumerateAllInstructions(true);
|
||||
expect(createTree(instructions)).toMatchObject({
|
||||
Advanced: {
|
||||
'Trigger once while true': {
|
||||
@@ -72,8 +72,8 @@ describe('EnumerateInstructions', () => {
|
||||
});
|
||||
|
||||
it('can find the object parameter, if any', () => {
|
||||
const actions = enumerateInstructions(false);
|
||||
const conditions = enumerateInstructions(true);
|
||||
const actions = enumerateAllInstructions(false);
|
||||
const conditions = enumerateAllInstructions(true);
|
||||
|
||||
const createInstruction = actions.filter(
|
||||
({ type }) => type === 'Create'
|
||||
|
Reference in New Issue
Block a user